aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-01-25 16:31:12 -0600
committersonartech <sonartech@sonarsource.com>2021-01-27 20:07:39 +0000
commitbc558d75337b2dc52ecce2c96868f97554c4a037 (patch)
treefd9178303d4ca54cdbe703dfc51a75dd85dc3745 /server
parent0592cda7b6c81fe07e68abe65ad8143aff2fb592 (diff)
downloadsonarqube-bc558d75337b2dc52ecce2c96868f97554c4a037.tar.gz
sonarqube-bc558d75337b2dc52ecce2c96868f97554c4a037.zip
SONAR-14394 Enable project binding for bitbucket cloud
Diffstat (limited to 'server')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/alm/setting/ALM.java1
-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.java8
3 files changed, 15 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/alm/setting/ALM.java b/server/sonar-db-dao/src/main/java/org/sonar/db/alm/setting/ALM.java
index c0dbdde23b0..4a8ba01fe24 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/alm/setting/ALM.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/alm/setting/ALM.java
@@ -24,6 +24,7 @@ import java.util.Locale;
public enum ALM {
GITHUB,
BITBUCKET,
+ BITBUCKET_CLOUD,
AZURE_DEVOPS,
GITLAB;
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 63df89088d4..8b27ec27dea 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
@@ -29,6 +29,7 @@ import static java.util.Arrays.stream;
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.newBitbucketProjectAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newGithubAlmSettingDto;
import static org.sonar.db.almsettings.AlmSettingsTesting.newGithubProjectAlmSettingDto;
@@ -64,6 +65,11 @@ public class AlmSettingsDbTester {
}
@SafeVarargs
+ public final AlmSettingDto insertBitbucketCloudAlmSetting(Consumer<AlmSettingDto>... populators) {
+ return insert(newBitbucketCloudAlmSettingDto(), populators);
+ }
+
+ @SafeVarargs
public final ProjectAlmSettingDto insertGitHubProjectAlmSetting(AlmSettingDto githubAlmSetting, ProjectDto project, Consumer<ProjectAlmSettingDto>... populators) {
return insertProjectAlmSetting(newGithubProjectAlmSettingDto(githubAlmSetting, 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 654dd0b61ff..bb3ce347d9a 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
@@ -62,6 +62,14 @@ public class AlmSettingsTesting {
.setAlm(ALM.BITBUCKET);
}
+ public static AlmSettingDto newBitbucketCloudAlmSettingDto() {
+ return new AlmSettingDto()
+ .setKey(randomAlphanumeric(200))
+ .setClientId(randomAlphanumeric(50))
+ .setClientSecret(randomAlphanumeric(50))
+ .setAlm(ALM.BITBUCKET_CLOUD);
+ }
+
public static ProjectAlmSettingDto newGithubProjectAlmSettingDto(AlmSettingDto githubAlmSetting, ProjectDto project) {
return new ProjectAlmSettingDto()
.setAlmSettingUuid(githubAlmSetting.getUuid())