RemoveProjectOnWorkspaceRemove implements EventSubscriber<WorkspaceRemovedEvent> { @Inject public void subscribe(EventService eventService) { eventService.subscribe(this); } @Inject  RemoveProjectOnWorkspaceRemove(OpenShiftProjectFactory projectFactory); @Inject void subscribe(EventService eventService); @Override void onEvent(WorkspaceRemovedEvent event);  }
@Test public void shouldSubscribeListenerToEventService() { EventService eventService = mock(EventService.class); removeProjectOnWorkspaceRemove.subscribe(eventService); verify(eventService).subscribe(removeProjectOnWorkspaceRemove); }