RemoveNamespaceOnWorkspaceRemove implements EventSubscriber<WorkspaceRemovedEvent> { @Inject public void subscribe(EventService eventService) { eventService.subscribe(this); } @Inject  RemoveNamespaceOnWorkspaceRemove(KubernetesNamespaceFactory namespaceFactory); @Inject void subscribe(EventService eventService); @Override void onEvent(WorkspaceRemovedEvent event);  }
@Test public void shouldSubscribeListenerToEventService() { EventService eventService = mock(EventService.class); removeNamespaceOnWorkspaceRemove.subscribe(eventService); verify(eventService).subscribe(removeNamespaceOnWorkspaceRemove); }