aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/testFixtures/java/org
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-01-28 10:20:38 -0600
committersonartech <sonartech@sonarsource.com>2021-01-29 20:07:55 +0000
commit00a4a9c77601ff6a1ea9516b7edc77b20f8a17c0 (patch)
tree2eca53a6874fba3aeda760197dc262608471157e /server/sonar-db-dao/src/testFixtures/java/org
parent09bd0ca18c132d56d98be34e9cc5c545e8787655 (diff)
downloadsonarqube-00a4a9c77601ff6a1ea9516b7edc77b20f8a17c0.tar.gz
sonarqube-00a4a9c77601ff6a1ea9516b7edc77b20f8a17c0.zip
SONAR-14393 Add configuration for Bitbucket Cloud settings
Diffstat (limited to 'server/sonar-db-dao/src/testFixtures/java/org')
-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);
+ }
}