aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsDbTester.java6
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java13
2 files changed, 17 insertions, 2 deletions
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsDbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsDbTester.java
index 8b27ec27dea..29d2bbc718b 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsDbTester.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsDbTester.java
@@ -30,6 +30,7 @@ import static org.sonar.db.almsettings.AlmSettingsTesting.newAzureAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newAzureProjectAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newBitbucketAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newBitbucketCloudAlmSettingDto;
+import static org.sonar.db.almsettings.AlmSettingsTesting.newBitbucketCloudProjectAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newBitbucketProjectAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newGithubAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newGithubProjectAlmSettingDto;
@@ -97,6 +98,11 @@ public class AlmSettingsDbTester {
}
@SafeVarargs
+ public final ProjectAlmSettingDto insertBitbucketCloudProjectAlmSetting(AlmSettingDto bbCloudAlmSetting, ProjectDto project, Consumer<ProjectAlmSettingDto>... populators) {
+ return insertProjectAlmSetting(newBitbucketCloudProjectAlmSettingDto(bbCloudAlmSetting, project), populators);
+ }
+
+ @SafeVarargs
public final ProjectAlmSettingDto insertBitbucketProjectAlmSetting(AlmSettingDto bitbucketAlmSetting, ProjectDto project, Consumer<ProjectAlmSettingDto>... populators) {
return insertProjectAlmSetting(newBitbucketProjectAlmSettingDto(bitbucketAlmSetting, project), populators);
}
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java
index bb3ce347d9a..02ea532af16 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java
@@ -66,6 +66,7 @@ public class AlmSettingsTesting {
return new AlmSettingDto()
.setKey(randomAlphanumeric(200))
.setClientId(randomAlphanumeric(50))
+ .setAppId(randomAlphanumeric(80))
.setClientSecret(randomAlphanumeric(50))
.setAlm(ALM.BITBUCKET_CLOUD);
}
@@ -95,12 +96,20 @@ public class AlmSettingsTesting {
.setMonorepo(false);
}
- public static ProjectAlmSettingDto newBitbucketProjectAlmSettingDto(AlmSettingDto githubAlmSetting, ProjectDto project) {
+ public static ProjectAlmSettingDto newBitbucketProjectAlmSettingDto(AlmSettingDto bitbucketAlmSetting, ProjectDto project) {
return new ProjectAlmSettingDto()
- .setAlmSettingUuid(githubAlmSetting.getUuid())
+ .setAlmSettingUuid(bitbucketAlmSetting.getUuid())
.setProjectUuid(project.getUuid())
.setAlmRepo(randomAlphanumeric(256))
.setAlmSlug(randomAlphanumeric(256))
.setMonorepo(false);
}
+
+ public static ProjectAlmSettingDto newBitbucketCloudProjectAlmSettingDto(AlmSettingDto bitbucketCloudAlmSetting, ProjectDto project) {
+ return new ProjectAlmSettingDto()
+ .setAlmSettingUuid(bitbucketCloudAlmSetting.getUuid())
+ .setProjectUuid(project.getUuid())
+ .setAlmRepo(randomAlphanumeric(256))
+ .setMonorepo(false);
+ }
}