From 7126f9a0e374165f67fc42d35500eb90ed59541e Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Tue, 18 Oct 2016 17:01:49 +0200 Subject: [PATCH] SONAR-8100 add PermissionTemplateDbTester to DbTester --- sonar-db/src/test/java/org/sonar/db/DbTester.java | 7 +++++++ .../org/sonar/db/permission/PermissionRepositoryTest.java | 2 +- .../template/GroupWithPermissionTemplateDaoTest.java | 2 +- .../db/permission/template/PermissionTemplateDaoTest.java | 2 +- 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); -- 2.39.5