Search in sources :

Example 16 with CallerMock

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);
}
Also used : SyncPromises(org.uberfire.promise.SyncPromises) SaveAndRenameCommandBuilder(org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder) CallerMock(org.uberfire.mocks.CallerMock) Before(org.junit.Before)

Aggregations

CallerMock (org.uberfire.mocks.CallerMock)16 Before (org.junit.Before)14 KieModule (org.kie.workbench.common.services.shared.project.KieModule)3 Command (org.uberfire.mvp.Command)3 Module (org.guvnor.common.services.project.model.Module)2 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)2 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)2 Repository (org.guvnor.structure.repositories.Repository)2 Test (org.junit.Test)2 SchemaMetadata (org.kie.workbench.common.screens.datasource.management.metadata.SchemaMetadata)2 Path (org.uberfire.backend.vfs.Path)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Optional (java.util.Optional)1 Event (javax.enterprise.event.Event)1 ProvisioningClientValidationService (org.guvnor.ala.ui.client.validation.ProvisioningClientValidationService)1 OpenShiftClientValidationService (org.guvnor.ala.ui.openshift.client.validation.OpenShiftClientValidationService)1 BuildResults (org.guvnor.common.services.project.builder.model.BuildResults)1 WorkspaceProjectContext (org.guvnor.common.services.project.client.context.WorkspaceProjectContext)1 ProjectController (org.guvnor.common.services.project.client.security.ProjectController)1