You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/16 05:45:03 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11931: Fix cannot save processDefinition

caishunfeng commented on code in PR #11931:
URL: https://github.com/apache/dolphinscheduler/pull/11931#discussion_r972633183


##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java:
##########
@@ -756,10 +753,13 @@ public void testUpdateProcessDefinition() {
         Mockito.when(projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_UPDATE))
                 .thenReturn(result);
 
-        Map<String, Object> updateResult =
-                processDefinitionService.updateProcessDefinition(loginUser, projectCode, "test", 1,
-                        "", "", "", 0, "root", null, "", null, ProcessExecutionTypeEnum.PARALLEL);
-        Assert.assertEquals(Status.DATA_IS_NOT_VALID, updateResult.get(Constants.STATUS));
+        try {
+            processDefinitionService.updateProcessDefinition(loginUser, projectCode, "test", 1,
+                    "", "", "", 0, "root", null, "", null, ProcessExecutionTypeEnum.PARALLEL);
+            Assert.fail();
+        } catch (ServiceException ex) {
+            Assert.assertEquals(Status.DATA_IS_NOT_VALID.getCode(), ex.getCode());
+        }

Review Comment:
   Maybe it's not a good case of Exception.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org