use of org.uberfire.mocks.CallerMock in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapperTest method setup.
@Before
public void setup() {
super.setup();
promises = new SyncPromises();
scenarioSimulationCaller = spy(new CallerMock<>(scenarioSimulationServiceMock));
importExportCaller = spy(new CallerMock<>(importExportServiceMock));
runnerReportServiceCaller = spy(new CallerMock<>(runnerReportServiceMock));
dmnTypeServiceCaller = spy(new CallerMock<>(dmnTypeServiceMock));
saveAndRenameCommandBuilderMock = spy(new SaveAndRenameCommandBuilder<>(null, null, null, null));
scenarioSimulationEditorBusinessClientWrapper = spy(new ScenarioSimulationEditorBusinessCentralWrapper(scenarioSimulationCaller, scenarioSimulationEditorPresenterMock, importsWidgetPresenterMock, oracleFactoryMock, placeManagerMock, dmnTypeServiceCaller, importExportCaller, runnerReportServiceCaller, sessionInfoMock, unpublishMessagesEventMock, scenarioSimulationBusinessCentralDocksHandlerMock) {
{
this.kieView = kieViewMock;
this.overviewWidget = overviewWidgetPresenterMock;
this.fileMenuBuilder = fileMenuBuilderMock;
this.fileNameValidator = fileNameValidatorMock;
this.versionRecordManager = versionRecordManagerMock;
this.notification = notificationMock;
this.workbenchContext = workbenchContextMock;
this.alertsButtonMenuItemBuilder = alertsButtonMenuItemBuilderMock;
this.docks = docksMock;
this.perspectiveManager = perspectiveManagerMock;
this.baseView = scenarioSimulationViewMock;
this.promises = ScenarioSimulationEditorBusinessCentralWrapperTest.this.promises;
this.metadata = metaDataMock;
this.saveAndRenameCommandBuilder = saveAndRenameCommandBuilderMock;
this.assetUpdateValidator = assetUpdateValidatorMock;
this.projectController = projectControllerMock;
this.place = placeRequestMock;
}
});
when(placeRequestMock.getPath()).thenReturn(observablePathMock);
when(scenarioSimulationEditorPresenterMock.getType()).thenReturn(scenarioSimulationResourceType);
when(scenarioSimulationEditorPresenterMock.getPopulateTestToolsCommand()).thenReturn(populateTestToolsCommand);
when(scenarioSimulationEditorPresenterMock.getJsonModel(any())).thenReturn("");
when(scenarioSimulationEditorPresenterMock.getView()).thenReturn(scenarioSimulationViewMock);
when(scenarioSimulationEditorPresenterMock.getModel()).thenReturn(scenarioSimulationModelMock);
when(scenarioSimulationEditorPresenterMock.getContext()).thenReturn(scenarioSimulationContextLocal);
when(scenarioSimulationEditorPresenterMock.getExportCallBack()).thenReturn(exportCallBackMock);
when(scenarioSimulationEditorPresenterMock.getPath()).thenReturn(pathMock);
when(alertsButtonMenuItemBuilderMock.build()).thenReturn(alertsButtonMenuItemMock);
when(versionRecordManagerMock.buildMenu()).thenReturn(versionRecordMenuItemMock);
when(scenarioGridWidgetSpy.getScenarioSimulationContext()).thenReturn(scenarioSimulationContextLocal);
when(kieViewMock.getMultiPage()).thenReturn(multiPageEditorMock);
when(multiPageEditorMock.getView()).thenReturn(multiPageEditorViewMock);
when(multiPageEditorViewMock.getTabBar()).thenReturn(navTabsMock);
when(multiPageEditorViewMock.getPageIndex(CommonConstants.INSTANCE.EditTabTitle())).thenReturn(SIMULATION_TAB_INDEX);
when(multiPageEditorViewMock.getPageIndex(ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle())).thenReturn(BACKGROUND_TAB_INDEX);
when(navTabsMock.getWidget(SIMULATION_TAB_INDEX)).thenReturn(simulationTabListItemMock);
when(navTabsMock.getWidget(BACKGROUND_TAB_INDEX)).thenReturn(backgroundTabListItemMock);
when(scenarioSimulationBusinessCentralDocksHandlerMock.getCoverageReportPresenter()).thenReturn(coverageReportPresenterMock);
when(scenarioSimulationBusinessCentralDocksHandlerMock.getTestRunnerReportingPanelWidget()).thenReturn(testRunnerReportingPanelWidgetMock);
when(simulationRunResultMock.getTestResultMessage()).thenReturn(testResultMessageMock);
when(simulationRunResultMock.getSimulationRunMetadata()).thenReturn(simulationRunMetadataMock);
when(sessionInfoMock.getId()).thenReturn(SESSION_ID);
}
Aggregations