aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/testFixtures/java
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-db-dao/src/testFixtures/java')
-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) {