diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-02-07 18:18:03 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-02-10 09:48:36 +0100 |
commit | ed1a03a47232447cc27821afcb2c2cb8794b4f86 (patch) | |
tree | af592046857a7a346356e60b10c8e6732856772c /sonar-db/src | |
parent | caf7aba77fe1148e0514ab0fa24a5507d585ad37 (diff) | |
download | sonarqube-ed1a03a47232447cc27821afcb2c2cb8794b4f86.tar.gz sonarqube-ed1a03a47232447cc27821afcb2c2cb8794b4f86.zip |
SONAR-8754 api/organizations/create require root for guarded org
Diffstat (limited to 'sonar-db/src')
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/organization/OrganizationDbTester.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/organization/OrganizationDbTester.java b/sonar-db/src/test/java/org/sonar/db/organization/OrganizationDbTester.java index ee67f83555b..b6de3ebc321 100644 --- a/sonar-db/src/test/java/org/sonar/db/organization/OrganizationDbTester.java +++ b/sonar-db/src/test/java/org/sonar/db/organization/OrganizationDbTester.java @@ -19,6 +19,7 @@ */ package org.sonar.db.organization; +import java.util.function.Consumer; import javax.annotation.Nullable; import org.sonar.db.DbSession; import org.sonar.db.DbTester; @@ -40,12 +41,18 @@ public class OrganizationDbTester { return insert(OrganizationTesting.newOrganizationDto()); } + public OrganizationDto insert(Consumer<OrganizationDto> populator) { + OrganizationDto dto = OrganizationTesting.newOrganizationDto(); + populator.accept(dto); + return insert(dto); + } + public OrganizationDto insertForKey(String key) { - return insert(OrganizationTesting.newOrganizationDto().setKey(key)); + return insert(dto -> dto.setKey(key)); } public OrganizationDto insertForUuid(String organizationUuid) { - return insert(OrganizationTesting.newOrganizationDto().setUuid(organizationUuid)); + return insert(dto -> dto.setUuid(organizationUuid)); } /** |