Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement-16773][Parameter] Create project parameters-Field modify user adds default value #16775

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

sdhzwc
Copy link
Contributor

@sdhzwc sdhzwc commented Nov 6, 2024

Purpose of the pull request

close #16773

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@sdhzwc sdhzwc changed the title [Improvement-16773][Parameter] Create project parameters-Field modifier adds default value [Improvement-16773][Parameter] Create project parameters-Field modify user adds default value Nov 6, 2024
SbloodyS
SbloodyS previously approved these changes Nov 6, 2024
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SbloodyS SbloodyS added the bug Something isn't working label Nov 6, 2024
@SbloodyS SbloodyS added this to the 3.3.0 milestone Nov 6, 2024
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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assertions.assertEquals(1, projectParameter.getOperator());
Assertions.assertEquals(loginUser.getId(), projectParameter.getOperator());

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this UT have any help to this case? You need to add UT to ProjectParameterService and avoid mocking the result.

Copy link
Contributor Author

@sdhzwc sdhzwc Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you revert the change of projectParameterService the case still pass.

Copy link
Contributor Author

@sdhzwc sdhzwc Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you revert the change of projectParameterService the case still pass.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

The adjustment has been made, this should be suitable now

Copy link

sonarcloud bot commented Nov 7, 2024

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@SbloodyS SbloodyS merged commit 002da22 into apache:dev Nov 7, 2024
68 checks passed
@sdhzwc sdhzwc deleted the project_modify_user_add_defaule_value branch November 7, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][Parameter] Create project parameters - Field modifier adds default value
3 participants