@Test public void testTechViewRefresh() throws Exception { ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass( Command.class ); when( activeOptions.isTechnicalViewActive() ).thenReturn( true ); verify( menu ).addRefreshCommand( argumentCaptor.capture() ); argumentCaptor.getValue().execute(); verify( technicalViewPresenter ).refresh(); verify( businessViewPresenter, never() ).refresh(); }
private void refresh() { getActiveView().refresh(); }
ExplorerPresenter { private void refresh() { getActiveView().refresh(); } }
ExplorerPresenter { private void refresh() { getActiveView().refresh(); } ExplorerPresenter(); @Inject  ExplorerPresenter(final ExplorerView view,
                             final BusinessViewPresenter businessViewPresenter,
                             final TechnicalViewPresenter technicalViewPresenter,
                             final WorkspaceProjectContext context,
                             final ActiveContextOptions activeOptions,
                             final ExplorerMenu menu); }
ExplorerPresenter { private void refresh() { getActiveView().refresh(); } ExplorerPresenter(); @Inject  ExplorerPresenter(final ExplorerView view,
                             final BusinessViewPresenter businessViewPresenter,
                             final TechnicalViewPresenter technicalViewPresenter,
                             final WorkspaceProjectContext context,
                             final ActiveContextOptions activeOptions,
                             final ExplorerMenu menu); @OnStartup void onStartup(final PlaceRequest placeRequest); @WorkbenchPartView UberView<ExplorerPresenter> getView(); @WorkbenchPartTitle String getTitle(); @DefaultPosition Position getDefaultPosition(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); }
ExplorerPresenter { private void refresh() { getActiveView().refresh(); } ExplorerPresenter(); @Inject  ExplorerPresenter(final ExplorerView view,
                             final BusinessViewPresenter businessViewPresenter,
                             final TechnicalViewPresenter technicalViewPresenter,
                             final WorkspaceProjectContext context,
                             final ActiveContextOptions activeOptions,
                             final ExplorerMenu menu); @OnStartup void onStartup(final PlaceRequest placeRequest); @WorkbenchPartView UberView<ExplorerPresenter> getView(); @WorkbenchPartTitle String getTitle(); @DefaultPosition Position getDefaultPosition(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); public ExplorerMenu menu; }