NavigationExplorerScreen { @PostConstruct void init() { navTreeEditor.setOnSaveCommand(this::onNavTreeSaved); navTreeEditor.getSettings().setLiteralPerspective(i18n.capitalizeFirst(i18n.getPerspectiveResourceName())); navTreeEditor.getSettings().setGotoPerspectiveEnabled(true); if (navTreeEditor.getNavTree() == null && navigationManager.getNavTree() != null) { navTreeEditor.edit(navigationManager.getNavTree()); } } 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 testInitTreeAlreadySet() { when(navigationManager.getNavTree()).thenReturn(navTree); navigationExplorerScreen.init(); verify(navTreeEditor).edit(navTree); }