aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/testFixtures/java/org/sonar
diff options
context:
space:
mode:
authorbelen-pruvost-sonarsource <belen.pruvost@sonarsource.com>2021-07-29 07:33:08 +0200
committersonartech <sonartech@sonarsource.com>2021-08-09 20:03:17 +0000
commit91559d24f00bbbb682880540a68ac22209473550 (patch)
tree79ff0db310c78fc4f47a29779f6b24401edbdd1e /server/sonar-db-dao/src/testFixtures/java/org/sonar
parent317192fb5d026725f0ea0f83a9a9f94efa2bd299 (diff)
downloadsonarqube-91559d24f00bbbb682880540a68ac22209473550.tar.gz
sonarqube-91559d24f00bbbb682880540a68ac22209473550.zip
SONAR-15139 - Update Report Endpoints to work with Projects and Apps
Diffstat (limited to 'server/sonar-db-dao/src/testFixtures/java/org/sonar')
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java14
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java8
2 files changed, 13 insertions, 9 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 2a5b1680f7b..603528cdb08 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
@@ -151,6 +151,10 @@ public class ComponentDbTester {
return insertComponentAndBranchAndProject(ComponentTesting.newPrivateProjectDto(), true, branchPopulator, componentPopulator);
}
+ public final ComponentDto insertPublicProjectWithCustomBranch(Consumer<BranchDto> branchPopulator, Consumer<ComponentDto> componentPopulator) {
+ return insertComponentAndBranchAndProject(ComponentTesting.newPublicProjectDto(), false, branchPopulator, componentPopulator);
+ }
+
public final ComponentDto insertPrivateProjectWithCustomBranch(Consumer<BranchDto> branchPopulator, Consumer<ComponentDto> componentPopulator,
Consumer<ProjectDto> projectPopulator) {
return insertComponentAndBranchAndProject(ComponentTesting.newPrivateProjectDto(), true, branchPopulator, componentPopulator, projectPopulator);
@@ -161,23 +165,23 @@ public class ComponentDbTester {
}
public final ComponentDto insertPublicPortfolio(String uuid, Consumer<ComponentDto> dtoPopulator) {
- return insertComponentImpl(ComponentTesting.newView(uuid).setPrivate(false), false, dtoPopulator);
+ return insertComponentImpl(ComponentTesting.newPortfolio(uuid).setPrivate(false), false, dtoPopulator);
}
public final ComponentDto insertPublicPortfolio(Consumer<ComponentDto> dtoPopulator) {
- return insertComponentImpl(ComponentTesting.newView().setPrivate(false), false, dtoPopulator);
+ return insertComponentImpl(ComponentTesting.newPortfolio().setPrivate(false), false, dtoPopulator);
}
public final ComponentDto insertPrivatePortfolio() {
- return insertComponentImpl(ComponentTesting.newView().setPrivate(true), true, defaults());
+ return insertComponentImpl(ComponentTesting.newPortfolio().setPrivate(true), true, defaults());
}
public final ComponentDto insertPrivatePortfolio(String uuid, Consumer<ComponentDto> dtoPopulator) {
- return insertComponentImpl(ComponentTesting.newView(uuid).setPrivate(true), true, dtoPopulator);
+ return insertComponentImpl(ComponentTesting.newPortfolio(uuid).setPrivate(true), true, dtoPopulator);
}
public final ComponentDto insertPrivatePortfolio(Consumer<ComponentDto> dtoPopulator) {
- return insertComponentImpl(ComponentTesting.newView().setPrivate(true), true, dtoPopulator);
+ return insertComponentImpl(ComponentTesting.newPortfolio().setPrivate(true), true, dtoPopulator);
}
public final ComponentDto insertPublicApplication() {
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java
index 922794a3f5c..ce9fb35eea8 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java
@@ -155,11 +155,11 @@ public class ComponentTesting {
.setPrivate(isPrivate);
}
- public static ComponentDto newView() {
- return newView(Uuids.createFast());
+ public static ComponentDto newPortfolio() {
+ return newPortfolio(Uuids.createFast());
}
- public static ComponentDto newView(String uuid) {
+ public static ComponentDto newPortfolio(String uuid) {
return newPrivateProjectDto(uuid)
.setUuid(uuid)
.setScope(Scopes.PROJECT)
@@ -168,7 +168,7 @@ public class ComponentTesting {
}
public static ComponentDto newApplication() {
- return newView(Uuids.createFast()).setQualifier(Qualifiers.APP);
+ return newPortfolio(Uuids.createFast()).setQualifier(Qualifiers.APP);
}
public static ComponentDto newProjectCopy(ComponentDto project, ComponentDto view) {