diff options
author | Benjamin Campomenosi <109955405+benjamin-campomenosi-sonarsource@users.noreply.github.com> | 2023-05-11 16:42:13 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-05-11 20:03:13 +0000 |
commit | e2ce6c71ac90e3e875b7a719b23b88c9ff416601 (patch) | |
tree | 1889cd1c1635f8ba244be17418acada81604850e /server/sonar-webserver-webapi | |
parent | 8a3bfc11ba83a3072a0bf48a1649ba0006611475 (diff) | |
download | sonarqube-e2ce6c71ac90e3e875b7a719b23b88c9ff416601.tar.gz sonarqube-e2ce6c71ac90e3e875b7a719b23b88c9ff416601.zip |
SONAR-18856 refactor `project_badge_token`
Diffstat (limited to 'server/sonar-webserver-webapi')
-rw-r--r-- | server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenRenewActionIT.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenRenewActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenRenewActionIT.java index 8fdba0eee96..6caeda42ecd 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenRenewActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenRenewActionIT.java @@ -28,6 +28,7 @@ import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; +import org.sonar.db.component.ProjectData; import org.sonar.db.project.ProjectBadgeTokenDto; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.TokenType; @@ -47,7 +48,7 @@ public class TokenRenewActionIT { private final System2 system2 = mock(System2.class); @Rule - public DbTester db = DbTester.create(system2); + public DbTester db = DbTester.create(system2, true); @Rule public UserSessionRule userSession = UserSessionRule.standalone(); @@ -74,9 +75,9 @@ public class TokenRenewActionIT { @Test public void missing_project_admin_permission_should_fail() { - ComponentDto project = db.components().insertPrivateProject().getMainBranchComponent(); + ProjectData project = db.components().insertPrivateProject(); - TestRequest request = ws.newRequest().setParam("project", project.getKey()); + TestRequest request = ws.newRequest().setParam("project", project.getProjectDto().getKey()); Assertions.assertThatThrownBy(request::execute) .hasMessage("Insufficient privileges") |