Browse Source

[Test-4124][service] Add the testCreateCommand test of ProcessService Class (#5257)

* [uint test] Improve code test coverage of ProcessService class

* [Test-4124][service] Add the testCreateCommand test of ProcessService Class

Co-authored-by: liuziying <liuziying@longfor.com>
pull/3/MERGE
Bruce Lau 4 years ago committed by GitHub
parent
commit
3e64f43138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java

13
dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java

@ -464,4 +464,17 @@ public class ProcessServiceTest {
processService.changeOutParam(result,taskInstance);
}
@Test
public void testCreateCommand() {
Command command = new Command();
command.setProcessDefinitionId(123);
command.setCommandParam("{\"ProcessInstanceId\":222}");
command.setCommandType(CommandType.START_PROCESS);
int mockResult = 1;
Mockito.when(commandMapper.insert(command)).thenReturn(mockResult);
int exeMethodResult = processService.createCommand(command);
Assert.assertEquals(mockResult, exeMethodResult);
Mockito.verify(commandMapper, Mockito.times(1)).insert(command);
}
}

Loading…
Cancel
Save