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:
Useful because if the creation is successful, it will return
projectParameter. By verifying whether the modify user is the expected value,
we can 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]