diff options
author | Lukasz Jarocki <lukasz.jarocki@sonarsource.com> | 2023-05-23 10:27:06 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-06-01 20:02:59 +0000 |
commit | 92c132a13f46f23a5ecc5dee5dfdfb619e6fa65f (patch) | |
tree | af217205f33c28a90494945efaf680a587edd693 /server/sonar-webserver-es/src/testFixtures | |
parent | 36e9f01ad563aaeaae36dc6efc69e724f8c039c1 (diff) | |
download | sonarqube-92c132a13f46f23a5ecc5dee5dfdfb619e6fa65f.tar.gz sonarqube-92c132a13f46f23a5ecc5dee5dfdfb619e6fa65f.zip |
SONAR-18856 Refactor subportfolios and fix build and tests
Diffstat (limited to 'server/sonar-webserver-es/src/testFixtures')
-rw-r--r-- | server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java index 59d6417564f..abc0453fa77 100644 --- a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java +++ b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java @@ -22,6 +22,7 @@ package org.sonar.server.permission.index; import java.util.List; import java.util.stream.Stream; import org.sonar.db.component.ComponentDto; +import org.sonar.db.entity.EntityDto; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; @@ -52,12 +53,24 @@ public class PermissionIndexerTester { return allow(dto); } + public PermissionIndexerTester allowOnlyUser(EntityDto entityDto, UserDto user) { + IndexPermissions dto = new IndexPermissions(entityDto.getUuid(), entityDto.getQualifier()) + .addUserUuid(user.getUuid()); + return allow(dto); + } + public PermissionIndexerTester allowOnlyGroup(ComponentDto project, GroupDto group) { IndexPermissions dto = new IndexPermissions(project.uuid(), project.qualifier()) .addGroupUuid(group.getUuid()); return allow(dto); } + public PermissionIndexerTester allowOnlyGroup(EntityDto entityDto, GroupDto group) { + IndexPermissions dto = new IndexPermissions(entityDto.getUuid(), entityDto.getQualifier()) + .addGroupUuid(group.getUuid()); + return allow(dto); + } + public PermissionIndexerTester allow(IndexPermissions... indexPermissions) { return allow(stream(indexPermissions).toList()); } |