AbstractScenarioSimulationDocksHandler extends AbstractWorkbenchDocksHandler { protected Optional<SettingsView> getSettingsView(PlaceRequest placeRequest) { final Activity activity = placeManager.getActivity(placeRequest); if (activity == null) { return Optional.empty(); } else { final AbstractWorkbenchActivity settingsActivity = (AbstractWorkbenchActivity) activity; return Optional.of((SettingsView) settingsActivity.getWidget()); } }  @Override Collection<UberfireDock> provideDocks(final String perspectiveIdentifier); void addDocks(); void removeDocks(); void expandToolsDock(); abstract void expandTestResultsDock(); void resetDocks(); void setScesimEditorId(String scesimEditorId); Optional<CheatSheetView.Presenter> getCheatSheetPresenter(); Optional<TestToolsView.Presenter> getTestToolsPresenter(); Optional<SettingsView.Presenter> getSettingsPresenter(); static final String SCESIMEDITOR_ID; }
@Test public void getSettingsView() { SettingsView settingsViewMock = mock(SettingsView.class); AbstractWorkbenchActivity activityMock = mock(AbstractWorkbenchActivity.class); when(activityMock.getWidget()).thenReturn(settingsViewMock); PlaceRequest placeRequest = abstractScenarioSimulationDocksHandlerSpy.getCurrentRightDockPlaceRequest(SettingsPresenter.IDENTIFIER); when(placeManagerMock.getActivity(eq(placeRequest))).thenReturn(activityMock); Optional<SettingsView> optional = abstractScenarioSimulationDocksHandlerSpy.getSettingsView(placeRequest); assertSame(settingsViewMock, optional.get()); }