mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 19:27:38 +08:00
[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>
This commit is contained in:
parent
039d517c13
commit
3e64f43138
@ -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…
Reference in New Issue
Block a user