ruanwenjun commented on code in PR #16775:
URL: 
https://github.com/apache/dolphinscheduler/pull/16775#discussion_r1832015896


##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectParameterControllerTest.java:
##########
@@ -47,12 +48,17 @@ public class ProjectParameterControllerTest {
     @Test
     public void testCreateProjectParameter() {
         User loginUser = getGeneralUser();
+        Result successResult = getSuccessResult();
+        successResult.setData(getProjectParameter());
 
         
Mockito.when(projectParameterService.createProjectParameter(Mockito.any(), 
Mockito.anyLong(), Mockito.any(),
-                Mockito.any(), Mockito.any())).thenReturn(getSuccessResult());
+                Mockito.any(), Mockito.any())).thenReturn(successResult);
         Result result = 
projectParameterController.createProjectParameter(loginUser, 1, "key", "value",
                 DataType.VARCHAR.name());
         Assertions.assertEquals(Status.SUCCESS.getCode(), result.getCode());
+
+        ProjectParameter projectParameter = (ProjectParameter) 
result.getData();
+        Assertions.assertEquals(1, projectParameter.getOperator());

Review Comment:
   I means since the `projectParameterService.createProjectParameter` has been 
mocked, so the test case is meaningless, it can just test the api call is work 
but cannot test the logic in `projectParameterService`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to