aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-migration
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-10-24 10:54:15 +0200
committersonartech <sonartech@sonarsource.com>2024-10-24 20:02:44 +0000
commite0a940902f37156757e84544d0a876f47f69040f (patch)
tree988c74e5242ad1bb349148601bb207b7cf515b09 /server/sonar-db-migration
parentc11922595bf67a70a38588a6f7763fb6f6c14501 (diff)
downloadsonarqube-e0a940902f37156757e84544d0a876f47f69040f.tar.gz
sonarqube-e0a940902f37156757e84544d0a876f47f69040f.zip
SONAR-23427 Stop relying on Qualifiers, Scopes and ResourceType from the plugin API
Diffstat (limited to 'server/sonar-db-migration')
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
index c1d124b381d..58944b898c8 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
@@ -27,7 +27,6 @@ import javax.annotation.Nullable;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
-import org.sonar.api.resources.Qualifiers;
import org.sonar.db.MigrationDbTester;
import static java.util.stream.Collectors.toSet;
@@ -46,7 +45,7 @@ class FixDifferentUuidsForSubportfoliosIT {
@Test
void execute_shouldUpdatePortfoliosAndPortfolioProjectsAndPortfolioReferenceTable() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
- insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
+ insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, "SVW");
insertSubPortfolio(SUB_PF_KEY, PF_UUID, PF_UUID, OLD_UUID);
insertPortfolioProject("projUuid", OLD_UUID);
insertPortfolioReference("refUuid", OLD_UUID);
@@ -61,7 +60,7 @@ class FixDifferentUuidsForSubportfoliosIT {
@Test
void execute_shouldBeRentrant() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
- insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
+ insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, "SVW");
insertSubPortfolio(SUB_PF_KEY, PF_UUID, PF_UUID, OLD_UUID);
insertPortfolioProject("projUuid", OLD_UUID);
insertPortfolioReference("refUuid", OLD_UUID);
@@ -78,8 +77,8 @@ class FixDifferentUuidsForSubportfoliosIT {
void execute_shouldFixUuidForSubPortfolioAtDifferentLevels() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
- insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
- insertComponent("child_subpfkey", NEW_CHILD_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
+ insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, "SVW");
+ insertComponent("child_subpfkey", NEW_CHILD_SUBPF_UUID, PF_UUID, "SVW");
insertSubPortfolio(SUB_PF_KEY, PF_UUID, PF_UUID, OLD_UUID);
insertSubPortfolio("child_subpfkey", OLD_UUID, PF_UUID, OLD_CHILD_SUBPF_UUID);
@@ -101,7 +100,6 @@ class FixDifferentUuidsForSubportfoliosIT {
.collect(toSet());
}
-
private String insertComponent(String key, String uuid, String branchUuid, String qualifier) {
Map<String, Object> map = new HashMap<>();
map.put("UUID", uuid);
@@ -136,7 +134,6 @@ class FixDifferentUuidsForSubportfoliosIT {
map.put("CREATED_AT", System.currentTimeMillis());
map.put("UPDATED_AT", System.currentTimeMillis());
-
db.executeInsert("portfolios", map);
return uuid;
}