]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA fixed unit tests after resolving the conflicts
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Tue, 13 Jun 2023 11:49:19 +0000 (13:49 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 19 Jun 2023 20:03:14 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/RemoveGroupActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/RemoveUserActionIT.java

index 5475fb725f1a0871062a9a252fd12622fe0a95d0..49db2fdfd461664c116953d85a72b3b7af954da6 100644 (file)
@@ -410,16 +410,16 @@ public class RemoveGroupActionIT extends BasePermissionWsIT<RemoveGroupAction> {
 
   @Test
   public void wsAction_whenRemovingLastOwnBrowsePermissionForPrivateProject_shouldFail() {
-    ComponentDto project = db.components().insertPrivateProject().getMainBranchComponent();
+    ProjectDto project = db.components().insertPrivateProject().getProjectDto();
     UserDto user = db.users().insertUser();
     GroupDto projectAdminGroup = db.users().insertGroup();
-    db.users().insertProjectPermissionOnGroup(projectAdminGroup, UserRole.USER, project);
-    db.users().insertProjectPermissionOnGroup(projectAdminGroup, UserRole.ADMIN, project);
+    db.users().insertEntityPermissionOnGroup(projectAdminGroup, UserRole.USER, project);
+    db.users().insertEntityPermissionOnGroup(projectAdminGroup, UserRole.ADMIN, project);
 
     userSession.logIn(user).setGroups(projectAdminGroup).addProjectPermission(UserRole.USER, project).addProjectPermission(UserRole.ADMIN, project);
 
     TestRequest testRequest = newRequest()
-      .setParam(PARAM_PROJECT_ID, project.uuid())
+      .setParam(PARAM_PROJECT_ID, project.getUuid())
       .setParam(PARAM_GROUP_NAME, projectAdminGroup.getName())
       .setParam(PARAM_PERMISSION, UserRole.USER);
 
index d490854d8ed9caa12ebd8c3515f85f58d6388da6..3948b6de3abdd4b259d1f601e7382b7e3b1d8afb 100644 (file)
@@ -119,12 +119,12 @@ public class RemoveUserActionIT extends BasePermissionWsIT<RemoveUserAction> {
   public void wsAction_whenPrivateProjectAdminRemovesOwnBrowsePermission_shouldFail() {
     loginAsAdmin();
     UserDto admin = db.users().insertUser(requireNonNull(userSession.getLogin()));
-    ComponentDto project = db.components().insertPrivateProject().getMainBranchComponent();
+    ProjectDto project = db.components().insertPrivateProject().getProjectDto();
     db.users().insertProjectPermissionOnUser(admin, GlobalPermission.ADMINISTER.getKey(), project);
 
     TestRequest request = newRequest()
       .setParam(PARAM_USER_LOGIN, userSession.getLogin())
-      .setParam(PARAM_PROJECT_ID, project.uuid())
+      .setParam(PARAM_PROJECT_ID, project.getUuid())
       .setParam(PARAM_PERMISSION, UserRole.USER);
 
     assertThatThrownBy(request::execute)