Search in sources :

Example 11 with MigrateResult

use of org.kie.workbench.common.stunner.bpmn.integration.service.MigrateResult in project kie-wb-common by kiegroup.

the class IntegrationHandlerImplTest method testMigrateFromStunnerWithServiceError.

private void testMigrateFromStunnerWithServiceError(boolean isDirty) {
    MigrateRequest expectedRequest = MigrateRequest.newFromStunnerToJBPMDesigner(stunnerPath, STUNNER_NAME, BPMN2_EXTENSION, ToJBPMCommitMessage);
    Path resultPath = mock(Path.class);
    String messageKey = "messageKey";
    List<?> messageArguments = new ArrayList<>();
    MigrateResult result = new MigrateResult(resultPath, IntegrationService.ServiceError.JBPM_DESIGNER_PROCESS_ALREADY_EXIST, messageKey, messageArguments);
    when(integrationService.migrateDiagram(expectedRequest)).thenReturn(result);
    handler.migrateFromStunnerToJBPMDesigner(stunnerPath, place, isDirty, saveSuccessfulCommand);
    verifySavePopupWasShownAndRespond(isDirty, true);
    verifyUserWasAskedForStartingToJBPMMigrationAndRespond(true);
    when(translationService.getValue(messageKey, messageArguments.toArray())).thenReturn(ERROR);
    errorPopup.showMessage(ERROR);
}
Also used : Path(org.uberfire.backend.vfs.Path) MigrateResult(org.kie.workbench.common.stunner.bpmn.integration.service.MigrateResult) ArrayList(java.util.ArrayList) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) MigrateRequest(org.kie.workbench.common.stunner.bpmn.integration.service.MigrateRequest)

Aggregations

MigrateResult (org.kie.workbench.common.stunner.bpmn.integration.service.MigrateResult)11 Path (org.uberfire.backend.vfs.Path)10 MigrateRequest (org.kie.workbench.common.stunner.bpmn.integration.service.MigrateRequest)9 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)2 ProjectDiagram (org.kie.workbench.common.stunner.project.diagram.ProjectDiagram)2 ProjectMetadata (org.kie.workbench.common.stunner.project.diagram.ProjectMetadata)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 FileSystem (org.uberfire.java.nio.file.FileSystem)2 MarshallingMessage (org.kie.workbench.common.stunner.core.marshaller.MarshallingMessage)1 CommentedOption (org.uberfire.java.nio.base.options.CommentedOption)1