aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-10-18 17:01:49 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-10-20 17:17:53 +0200
commit7126f9a0e374165f67fc42d35500eb90ed59541e (patch)
tree049ca9629f677decc00ec4808d05098993f2fe0f /sonar-db
parent3201be2777a5cc1db23b0bb9b4b7130da6327fe4 (diff)
downloadsonarqube-7126f9a0e374165f67fc42d35500eb90ed59541e.tar.gz
sonarqube-7126f9a0e374165f67fc42d35500eb90ed59541e.zip
SONAR-8100 add PermissionTemplateDbTester to DbTester
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/DbTester.java7
-rw-r--r--sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/permission/template/GroupWithPermissionTemplateDaoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java2
4 files changed, 10 insertions, 3 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/DbTester.java b/sonar-db/src/test/java/org/sonar/db/DbTester.java
index a8898ae675a..8a475b5de57 100644
--- a/sonar-db/src/test/java/org/sonar/db/DbTester.java
+++ b/sonar-db/src/test/java/org/sonar/db/DbTester.java
@@ -68,6 +68,7 @@ import org.sonar.db.component.ComponentDbTester;
import org.sonar.db.organization.OrganizationDbTester;
import org.sonar.db.organization.OrganizationDto;
import org.sonar.db.organization.OrganizationTesting;
+import org.sonar.db.permission.template.PermissionTemplateDbTester;
import org.sonar.db.user.RootFlagAssertions;
import org.sonar.db.user.UserDbTester;
@@ -98,6 +99,7 @@ public class DbTester extends ExternalResource {
private final UserDbTester userTester;
private final ComponentDbTester componentTester;
private final OrganizationDbTester organizationTester;
+ private final PermissionTemplateDbTester permissionTemplateTester;
private final RootFlagAssertions rootFlagAssertions;
private DbTester(System2 system2, @Nullable String schemaPath) {
@@ -107,6 +109,7 @@ public class DbTester extends ExternalResource {
this.userTester = new UserDbTester(this);
this.componentTester = new ComponentDbTester(this);
this.organizationTester = new OrganizationDbTester(this);
+ this.permissionTemplateTester = new PermissionTemplateDbTester(this);
this.rootFlagAssertions = new RootFlagAssertions(this);
}
@@ -175,6 +178,10 @@ public class DbTester extends ExternalResource {
return organizationTester;
}
+ public PermissionTemplateDbTester permissionTemplates() {
+ return permissionTemplateTester;
+ }
+
public RootFlagAssertions rootFlag() {
return rootFlagAssertions;
}
diff --git a/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java b/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java
index ab0436797c6..0d2b62332d8 100644
--- a/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java
@@ -59,7 +59,7 @@ public class PermissionRepositoryTest {
@Rule
public DbTester dbTester = DbTester.create(system2);
- private PermissionTemplateDbTester templateDb = new PermissionTemplateDbTester(dbTester);
+ private PermissionTemplateDbTester templateDb = dbTester.permissionTemplates();
private DbSession session = dbTester.getSession();
private Settings settings = new MapSettings();
private PermissionRepository underTest = new PermissionRepository(dbTester.getDbClient(), settings);
diff --git a/sonar-db/src/test/java/org/sonar/db/permission/template/GroupWithPermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/template/GroupWithPermissionTemplateDaoTest.java
index 5fae6e7d84c..6cf5abc3adc 100644
--- a/sonar-db/src/test/java/org/sonar/db/permission/template/GroupWithPermissionTemplateDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/permission/template/GroupWithPermissionTemplateDaoTest.java
@@ -44,7 +44,7 @@ public class GroupWithPermissionTemplateDaoTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
private DbSession session = db.getSession();
- private PermissionTemplateDbTester permissionTemplateDbTester = new PermissionTemplateDbTester(db);
+ private PermissionTemplateDbTester permissionTemplateDbTester = db.permissionTemplates();
private PermissionTemplateDao underTest = db.getDbClient().permissionTemplateDao();
@Test
diff --git a/sonar-db/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
index 1805f9f807e..b799080d195 100644
--- a/sonar-db/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
@@ -56,7 +56,7 @@ public class PermissionTemplateDaoTest {
@Rule
public DbTester db = DbTester.create(system);
private DbSession dbSession = db.getSession();
- private PermissionTemplateDbTester templateDb = new PermissionTemplateDbTester(db);
+ private PermissionTemplateDbTester templateDb = db.permissionTemplates();
private PermissionTemplateDao underTest = new PermissionTemplateDao(system);