sdhzwc commented on code in PR #16775:
URL:
https://github.com/apache/dolphinscheduler/pull/16775#discussion_r1831918013
##########
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:
> Does this UT have any help to this case? You need to add UT to
`ProjectParameterService` and avoid mocking the result.
Useful because if created successfully, it returns projectParameter. We can
verify if the modify user has a value to determine if the addition was
successful
--
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]