|
|
|
@ -555,7 +555,7 @@ public class ProcessInstanceServiceTest {
|
|
|
|
|
when(projectMapper.queryByCode(projectCode)).thenReturn(project); |
|
|
|
|
when(projectService.checkProjectAndAuth(loginUser, project, projectCode, INSTANCE_UPDATE)).thenReturn(result); |
|
|
|
|
Map<String, Object> projectAuthFailRes = processInstanceService.updateProcessInstance(loginUser, projectCode, 1, |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0, ""); |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0); |
|
|
|
|
Assertions.assertEquals(Status.PROJECT_NOT_FOUND, projectAuthFailRes.get(Constants.STATUS)); |
|
|
|
|
|
|
|
|
|
// process instance null
|
|
|
|
@ -566,7 +566,7 @@ public class ProcessInstanceServiceTest {
|
|
|
|
|
when(processService.findProcessInstanceDetailById(1)).thenReturn(Optional.empty()); |
|
|
|
|
Assertions.assertThrows(ServiceException.class, () -> { |
|
|
|
|
processInstanceService.updateProcessInstance(loginUser, projectCode, 1, |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0, ""); |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0); |
|
|
|
|
}); |
|
|
|
|
// process instance not finish
|
|
|
|
|
when(processService.findProcessInstanceDetailById(1)).thenReturn(Optional.ofNullable(processInstance)); |
|
|
|
@ -574,7 +574,7 @@ public class ProcessInstanceServiceTest {
|
|
|
|
|
putMsg(result, Status.SUCCESS, projectCode); |
|
|
|
|
Map<String, Object> processInstanceNotFinishRes = |
|
|
|
|
processInstanceService.updateProcessInstance(loginUser, projectCode, 1, |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0, ""); |
|
|
|
|
shellJson, taskJson, "2020-02-21 00:00:00", true, "", "", 0); |
|
|
|
|
Assertions.assertEquals(Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, |
|
|
|
|
processInstanceNotFinishRes.get(Constants.STATUS)); |
|
|
|
|
|
|
|
|
@ -602,7 +602,7 @@ public class ProcessInstanceServiceTest {
|
|
|
|
|
when(taskPluginManager.checkTaskParameters(Mockito.any())).thenReturn(true); |
|
|
|
|
Map<String, Object> processInstanceFinishRes = |
|
|
|
|
processInstanceService.updateProcessInstance(loginUser, projectCode, 1, |
|
|
|
|
taskRelationJson, taskDefinitionJson, "2020-02-21 00:00:00", true, "", "", 0, "root"); |
|
|
|
|
taskRelationJson, taskDefinitionJson, "2020-02-21 00:00:00", true, "", "", 0); |
|
|
|
|
Assertions.assertEquals(Status.SUCCESS, processInstanceFinishRes.get(Constants.STATUS)); |
|
|
|
|
|
|
|
|
|
// success
|
|
|
|
@ -612,7 +612,7 @@ public class ProcessInstanceServiceTest {
|
|
|
|
|
when(processService.saveProcessDefine(loginUser, processDefinition, Boolean.FALSE, Boolean.FALSE)) |
|
|
|
|
.thenReturn(1); |
|
|
|
|
Map<String, Object> successRes = processInstanceService.updateProcessInstance(loginUser, projectCode, 1, |
|
|
|
|
taskRelationJson, taskDefinitionJson, "2020-02-21 00:00:00", Boolean.FALSE, "", "", 0, "root"); |
|
|
|
|
taskRelationJson, taskDefinitionJson, "2020-02-21 00:00:00", Boolean.FALSE, "", "", 0); |
|
|
|
|
Assertions.assertEquals(Status.SUCCESS, successRes.get(Constants.STATUS)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|