NavigationExplorerScreen { void onPerspectivesChanged(@Observes PerspectivePluginsChangedEvent event) { NavTree navTree = navigationManager.getNavTree(); if (navTree != null) { navTreeEditor.edit(navTree); } } NavigationExplorerScreen(); @Inject  NavigationExplorerScreen(NavigationManager navigationManager,
                                 NavTreeEditor navTreeEditor,
                                 ContentManagerI18n i18n,
                                 Event<NotificationEvent> workbenchNotification); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); NavTreeEditor getNavTreeEditor(); void createNewNavigationTree(); void onNavTreeChanged(@Observes final NavTreeChangedEvent event); static final String SCREEN_ID; }
@Test public void testOnPerspectivesChanged() { navigationExplorerScreen.init(); when(navigationManager.getNavTree()).thenReturn(navTree); navigationExplorerScreen.onPerspectivesChanged(new PerspectivePluginsChangedEvent()); verify(navTreeEditor, times(1)).edit(any(NavTree.class)); }