ScenarioSimulationEditorPresenter { protected void onExportToCsv() { context.getSelectedGridWidget().ifPresent(gridWidget -> scenarioSimulationEditorWrapper .onExportToCsv(getExportCallBack(), new ScenarioSimulationHasBusyIndicatorDefaultErrorCallback(view), context.getAbstractScesimModelByGridWidget(gridWidget))); } ScenarioSimulationEditorPresenter(); @Inject  ScenarioSimulationEditorPresenter(final AbstractScenarioSimulationProducer abstractScenarioSimulationProducer,
                                             final ScenarioSimulationResourceType type,
                                             final PlaceManager placeManager,
                                             final AbstractScenarioSimulationDocksHandler abstractScenarioSimulationDocksHandler,
                                             final TextFileExport textFileExport,
                                             final ConfirmPopupPresenter confirmPopupPresenter); void setWrapper(ScenarioSimulationEditorWrapper scenarioSimulationEditorWrapper); void setPath(ObservablePath path); ObservablePath getPath(); void setPackageName(String packageName); void onClose(); void showDocks(PlaceStatus status); void hideDocks(); void onUberfireDocksInteractionEvent(@Observes final UberfireDocksInteractionEvent uberfireDocksInteractionEvent); void expandToolsDock(); ScenarioSimulationView getView(); ScenarioSimulationModel getModel(); Command getPopulateTestToolsCommand(); void reloadTestTools(boolean disable); void onRunScenario(); void onRunScenario(List<Integer> indexOfScenarioToRun); void onUndo(); void onRedo(); void setUndoButtonEnabledStatus(boolean enabled); void setRedoButtonEnabledStatus(boolean enabled); void setItemMenuEnabled(boolean enabled); void addDownloadMenuItem(FileMenuBuilder fileMenuBuilder, Supplier<Path> pathSupplier); DataManagementStrategy getDataManagementStrategy(); void onImport(String fileContents, GridWidget gridWidget); EventBus getEventBus(); ScenarioSimulationContext getContext(); void sendNotification(String text, NotificationEvent.NotificationType type); void sendNotification(String text, NotificationEvent.NotificationType type, boolean autoHide); void makeMenuBar(FileMenuBuilder fileMenuBuilder); void addCommonActions(final FileMenuBuilder fileMenuBuilder, MenuItem versionMenuItem, MenuItem alertsButtonMenuItem); void loadContent(); boolean isDirty(); void onEditTabSelected(); void onBackgroundTabSelected(); void onOverviewSelected(); void onImportsTabSelected(); void validateSimulation(); void selectSimulationTab(); void selectBackgroundTab(); RemoteCallback<String> getExportCallBack(); ErrorCallback<Boolean> getValidationFailedCallback(); void populateRightDocks(String identifier); void getModelSuccessCallbackMethod(DataManagementStrategy dataManagementStrategy, ScenarioSimulationModel model); ScenarioSimulationResourceType getType(); void setTestTools(TestToolsView.Presenter presenter); void setCheatSheet(CheatSheetView.Presenter presenter); void setSettings(SettingsView.Presenter presenter); String getJsonModel(ScenarioSimulationModel model); static final String IDENTIFIER; }
@Test public void onExportToCsvSIMULATION() { when(backgroundGridWidgetSpy.isSelected()).thenReturn(false); when(scenarioGridWidgetSpy.isSelected()).thenReturn(true); presenterSpy.onExportToCsv(); verify(scenarioSimulationEditorWrapperMock, times(1)).onExportToCsv(isA(RemoteCallback.class), isA(ScenarioSimulationHasBusyIndicatorDefaultErrorCallback.class), eq(simulationMock)); }