aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorBenjamin Campomenosi <benjamin.campomenosi@sonarsource.com>2023-06-30 11:24:52 +0200
committersonartech <sonartech@sonarsource.com>2023-07-03 20:03:13 +0000
commit2311fc452d9ea07308d45cd60f2b577c544a841b (patch)
tree5b351644a207a929fb0c797b56bb80c43cd8e508 /server/sonar-db-dao
parentad3f4619ac786ff17da46bd051abb4d8ea901130 (diff)
downloadsonarqube-2311fc452d9ea07308d45cd60f2b577c544a841b.tar.gz
sonarqube-2311fc452d9ea07308d45cd60f2b577c544a841b.zip
SONAR-19558 Refactor rest of test in webapi module
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java6
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/PortfolioData.java7
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectData.java5
3 files changed, 18 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
index 277cacdc820..1d3de422b56 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
@@ -235,6 +235,12 @@ public class ComponentDbTester {
return new PortfolioData(portfolioDto, component);
}
+ public final PortfolioData insertPrivatePortfolioData(Consumer<ComponentDto> dtoPopulator) {
+ ComponentDto component = insertComponentAndPortfolio(ComponentTesting.newPortfolio().setPrivate(true), true, dtoPopulator, defaults());
+ PortfolioDto portfolioDto = getPortfolioDto(component);
+ return new PortfolioData(portfolioDto, component);
+ }
+
public final PortfolioDto insertPrivatePortfolioDto(Consumer<ComponentDto> dtoPopulator) {
ComponentDto component = insertComponentAndPortfolio(ComponentTesting.newPortfolio().setPrivate(true), true, dtoPopulator, defaults());
return getPortfolioDto(component);
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/PortfolioData.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/PortfolioData.java
index 9838f01c9f0..a76d4ba6adc 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/PortfolioData.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/PortfolioData.java
@@ -39,4 +39,11 @@ public class PortfolioData {
return portfolioDto;
}
+ public String portfolioUuid(){
+ return portfolioDto.getUuid();
+ }
+
+ public String rootComponentUuid(){
+ return rootComponent.uuid();
+ }
}
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectData.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectData.java
index 33c870a61b0..80392f266b0 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectData.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectData.java
@@ -51,4 +51,9 @@ public class ProjectData {
public String projectKey() {
return projectDto.getKey();
}
+
+ public String mainBranchUuid(){
+ return mainBranchDto.getUuid();
+ }
+
}