Search in sources :

Example 11 with MarshallingMessage

use of org.kie.workbench.common.stunner.core.marshaller.MarshallingMessage in project kie-wb-common by kiegroup.

the class IntegrationHandlerImplTest method testMigrateFromJBPMDesignerToStunnerMarshallingWithErrors.

private void testMigrateFromJBPMDesignerToStunnerMarshallingWithErrors(boolean isDirty) {
    List<MarshallingMessage> messages = Arrays.asList(mock(MarshallingMessage.class), mock(MarshallingMessage.class));
    prepareMigrateFromJBPMDesignerToStunner(MarshallingResponse.State.ERROR, messages);
    MigrateRequest expectedRequest = MigrateRequest.newFromJBPMDesignerToStunner(jbpmPath, JBPM_NAME, BPMN_EXTENSION, ToStunnerCommitMessage, projectDiagram);
    MigrateResult result = new MigrateResult(null, IntegrationService.ServiceError.JBPM_DESIGNER_PROCESS_ALREADY_EXIST, "messageKey", new ArrayList<>());
    when(integrationService.migrateDiagram(expectedRequest)).thenReturn(result);
    handler.migrateFromJBPMDesignerToStunner(jbpmPath, place, isDirty, saveSuccessfulCommand);
    // ask user for saving and say yes.
    verifySavePopupWasShownAndRespond(isDirty, true);
    // ask user for starting the migration and say yes
    verifyUserWasAskedForStartingToStunnerMigrationAndRespond(true);
    verifyMarshallingResponseWithErrorsWereShown(messages);
}
Also used : MarshallingMessage(org.kie.workbench.common.stunner.core.marshaller.MarshallingMessage) MigrateResult(org.kie.workbench.common.stunner.bpmn.integration.service.MigrateResult) MigrateRequest(org.kie.workbench.common.stunner.bpmn.integration.service.MigrateRequest)

Aggregations

MarshallingMessage (org.kie.workbench.common.stunner.core.marshaller.MarshallingMessage)11 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)6 MarshallingResponse (org.kie.workbench.common.stunner.core.marshaller.MarshallingResponse)4 Diagram (org.kie.workbench.common.stunner.core.diagram.Diagram)2 GwtMockitoTestRunner (com.google.gwtmockito.GwtMockitoTestRunner)1 InputStream (java.io.InputStream)1 Collection (java.util.Collection)1 Collections.singletonList (java.util.Collections.singletonList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Consumer (java.util.function.Consumer)1 BaseElement (org.eclipse.bpmn2.BaseElement)1 FlowElement (org.eclipse.bpmn2.FlowElement)1 Lane (org.eclipse.bpmn2.Lane)1 LaneSet (org.eclipse.bpmn2.LaneSet)1 ManualTask (org.eclipse.bpmn2.ManualTask)1 Task (org.eclipse.bpmn2.Task)1 BPMNEdge (org.eclipse.bpmn2.di.BPMNEdge)1 BPMNShape (org.eclipse.bpmn2.di.BPMNShape)1