You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/04/12 10:55:13 UTC

[incubator-dolphinscheduler] branch dev updated: [Test-4124][service] Add the testCreateCommand test of ProcessService Class (#5257)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3e64f43  [Test-4124][service] Add the testCreateCommand test of  ProcessService Class (#5257)
3e64f43 is described below

commit 3e64f43138d757720be9e167075c6fab4c0d4f70
Author: Bruce Lau <li...@163.com>
AuthorDate: Mon Apr 12 18:55:00 2021 +0800

    [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 <li...@longfor.com>
---
 .../service/process/ProcessServiceTest.java                 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java b/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java
index 999ca46..a693c2e 100644
--- a/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java
+++ b/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);
+    }
+
 }