@Test
public void shouldRegisterHandler() throws Exception {

    final ServiceComponentFoundEvent foundEvent = new ServiceComponentFoundEvent("COMMAND_API", bean, LOCAL);
    doReturn(Object.class).when(bean).getBeanClass();
    when(dispatcherCache.dispatcherFor(foundEvent)).thenReturn(dispatcher);
    when(beanInstantiater.instantiate(bean)).thenReturn(handler);
    serviceComponentObserver.register(foundEvent);
    verify(dispatcher).register(handler);
}