|
|
@ -343,7 +343,7 @@ public class TaskInstanceServiceTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void forceTaskSuccess() { |
|
|
|
public void testForceTaskSuccess() { |
|
|
|
User user = getAdminUser(); |
|
|
|
User user = getAdminUser(); |
|
|
|
long projectCode = 1L; |
|
|
|
long projectCode = 1L; |
|
|
|
Project project = getProject(projectCode); |
|
|
|
Project project = getProject(projectCode); |
|
|
@ -392,12 +392,14 @@ public class TaskInstanceServiceTest { |
|
|
|
|
|
|
|
|
|
|
|
// test success
|
|
|
|
// test success
|
|
|
|
task.setState(TaskExecutionStatus.FAILURE); |
|
|
|
task.setState(TaskExecutionStatus.FAILURE); |
|
|
|
|
|
|
|
task.setEndTime(null); |
|
|
|
when(taskInstanceMapper.updateById(task)).thenReturn(1); |
|
|
|
when(taskInstanceMapper.updateById(task)).thenReturn(1); |
|
|
|
putMsg(result, Status.SUCCESS, projectCode); |
|
|
|
putMsg(result, Status.SUCCESS, projectCode); |
|
|
|
when(projectMapper.queryByCode(projectCode)).thenReturn(project); |
|
|
|
when(projectMapper.queryByCode(projectCode)).thenReturn(project); |
|
|
|
when(projectService.checkProjectAndAuth(user, project, projectCode, FORCED_SUCCESS)).thenReturn(result); |
|
|
|
when(projectService.checkProjectAndAuth(user, project, projectCode, FORCED_SUCCESS)).thenReturn(result); |
|
|
|
Result successRes = taskInstanceService.forceTaskSuccess(user, projectCode, taskId); |
|
|
|
Result successRes = taskInstanceService.forceTaskSuccess(user, projectCode, taskId); |
|
|
|
Assertions.assertEquals(Status.SUCCESS.getCode(), successRes.getCode().intValue()); |
|
|
|
Assertions.assertEquals(Status.SUCCESS.getCode(), successRes.getCode().intValue()); |
|
|
|
|
|
|
|
Assertions.assertNotNull(task.getEndTime()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|