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-12853][UT] Improve the ut of ResourcePermissionCheckServiceTest #12854

Merged
merged 1 commit into from
Nov 19, 2022

Conversation

rickchengx
Copy link
Contributor

Purpose of the pull request

Currently, the ResourcePermissionCheckService is not well tested by the UT of ResourcePermissionCheckServiceTest because the object under test (i.e., resourcePermissionCheckService) is mocked by Mockito. The code logic of resourcePermissionCheckService is not covered by UT.

@Mock
private ResourcePermissionCheckService<Object> resourcePermissionCheckService;

public void testResourcePermissionCheck() {
User user = new User();
user.setId(1);
Object[] obj = new Object[]{1, 2};
boolean result = this.resourcePermissionCheckService.resourcePermissionCheck(AuthorizationType.PROJECTS, obj,
user.getId(), logger);
Assertions.assertFalse(result);
}

Brief change log

  • Improve the ut of ResourcePermissionCheckServiceTest

Verify this pull request

covered by UT

@SbloodyS SbloodyS added this to the 3.1.2 milestone Nov 10, 2022
@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Nov 10, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 16, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@EricGao888 EricGao888 modified the milestones: 3.1.2, 3.2.0 Nov 19, 2022
@EricGao888 EricGao888 added the 3.2.0 for 3.2.0 version label Nov 19, 2022
@EricGao888 EricGao888 merged commit 2051868 into apache:dev Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.0 for 3.2.0 version backend improvement make more easy to user or prompt friendly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][UT] Improve the ut of ResourcePermissionCheckServiceTest
3 participants