WorkspaceProjectContext { public void onModuleUpdated(@Observes final ModuleUpdatedEvent moduleUpdatedEvent) { if (activeModule != null && activeModule.getRootPath().equals(moduleUpdatedEvent.getOldModule().getRootPath())) { contextChangeEvent.fire(new WorkspaceProjectContextChangeEvent(new WorkspaceProject(activeWorkspaceProject.getOrganizationalUnit(), activeWorkspaceProject.getRepository(), activeWorkspaceProject.getBranch(), moduleUpdatedEvent.getNewModule()), moduleUpdatedEvent.getNewModule())); } } WorkspaceProjectContext(); @Inject  WorkspaceProjectContext(final Event<WorkspaceProjectContextChangeEvent> contextChangeEvent); void onOrganizationalUnitUpdated(@Observes final UpdatedOrganizationalUnitEvent event); void onModuleUpdated(@Observes final ModuleUpdatedEvent moduleUpdatedEvent); void onProjectContextChanged(@Observes final WorkspaceProjectContextChangeEvent event); Optional<Path> getActiveRepositoryRoot(); Optional<OrganizationalUnit> getActiveOrganizationalUnit(); Optional<WorkspaceProject> getActiveWorkspaceProject(); Optional<Module> getActiveModule(); Optional<Package> getActivePackage(); ProjectContextChangeHandle addChangeHandler(final WorkspaceProjectContextChangeHandler changeHandler); void removeChangeHandler(final ProjectContextChangeHandle projectContextChangeHandle); void updateProjectModule(final Module module);  }
@Test public void testNoUpdateWhenNoActiveModule() throws Exception { context.onModuleUpdated(new ModuleUpdatedEvent(getMockModule(), getMockModule())); verify(changeEvent, never()).fire(any()); }