### Question:
ExplorerPresenter { private void update() { getActiveView().update(); } 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; }### Answer:
@Test public void testTechViewUpdate() throws Exception { ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass( Command.class ); when( activeOptions.isTechnicalViewActive() ).thenReturn( true ); verify( menu ).addUpdateCommand( argumentCaptor.capture() ); argumentCaptor.getValue().execute(); verify( technicalViewPresenter ).update(); verify( businessViewPresenter, never() ).update(); }
@Test public void testBusinessViewUpdate() throws Exception { ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass( Command.class ); when( activeOptions.isBusinessViewActive() ).thenReturn( true ); verify( menu ).addUpdateCommand( argumentCaptor.capture() ); argumentCaptor.getValue().execute(); verify( technicalViewPresenter, never() ).update(); verify( businessViewPresenter ).update(); }