From 8c55e3949f8873619594a7da133202382cec48c7 Mon Sep 17 00:00:00 2001 From: Benjamin Campomenosi <109955405+benjamin-campomenosi-sonarsource@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:54:56 +0200 Subject: [PATCH] SONAR-19558 Refactor rest of test in project_analysis module --- .../analysis/ProjectConfigurationFactoryTest.java | 2 +- .../projectanalysis/component/ConfigurationRepositoryTest.java | 2 +- .../issue/PullRequestSourceBranchMergerTest.java | 2 +- .../ce/task/projectanalysis/issue/RuleRepositoryImplTest.java | 2 +- .../measure/MapBasedRawMeasureRepositoryTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/analysis/ProjectConfigurationFactoryTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/analysis/ProjectConfigurationFactoryTest.java index c70c6545bcb..4c283773e12 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/analysis/ProjectConfigurationFactoryTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/analysis/ProjectConfigurationFactoryTest.java @@ -31,7 +31,7 @@ import static org.sonar.db.property.PropertyTesting.newComponentPropertyDto; public class ProjectConfigurationFactoryTest { @Rule - public DbTester db = DbTester.create(); + public DbTester db = DbTester.create(true); private final MapSettings settings = new MapSettings(); private final ProjectConfigurationFactory underTest = new ProjectConfigurationFactory(settings, db.getDbClient()); diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ConfigurationRepositoryTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ConfigurationRepositoryTest.java index 56570aba1d3..c52c58c866b 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ConfigurationRepositoryTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ConfigurationRepositoryTest.java @@ -39,7 +39,7 @@ import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto; public class ConfigurationRepositoryTest { @Rule - public final DbTester db = DbTester.create(System2.INSTANCE); + public final DbTester db = DbTester.create(System2.INSTANCE, true); @Rule public AnalysisMetadataHolderRule analysisMetadataHolder = new AnalysisMetadataHolderRule(); diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/PullRequestSourceBranchMergerTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/PullRequestSourceBranchMergerTest.java index b8214e4fdec..76283d740a2 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/PullRequestSourceBranchMergerTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/PullRequestSourceBranchMergerTest.java @@ -73,7 +73,7 @@ public class PullRequestSourceBranchMergerTest { private NonClosedTracking prTracking; @Rule - public DbTester db = DbTester.create(); + public DbTester db = DbTester.create(true); private PullRequestSourceBranchMerger underTest; private RuleDto rule; diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/RuleRepositoryImplTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/RuleRepositoryImplTest.java index 59498fe155a..e910496ad99 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/RuleRepositoryImplTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/RuleRepositoryImplTest.java @@ -66,7 +66,7 @@ public class RuleRepositoryImplTest { @org.junit.Rule - public DbTester db = DbTester.create(System2.INSTANCE); + public DbTester db = DbTester.create(System2.INSTANCE, true); private DbClient dbClient = mock(DbClient.class); private DbSession dbSession = mock(DbSession.class); diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/measure/MapBasedRawMeasureRepositoryTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/measure/MapBasedRawMeasureRepositoryTest.java index 6d1988ff476..57f8c1f5ea9 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/measure/MapBasedRawMeasureRepositoryTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/measure/MapBasedRawMeasureRepositoryTest.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.when; @RunWith(DataProviderRunner.class) public class MapBasedRawMeasureRepositoryTest { @Rule - public DbTester dbTester = DbTester.create(System2.INSTANCE); + public DbTester dbTester = DbTester.create(System2.INSTANCE, true); private static final String FILE_COMPONENT_KEY = "file cpt key"; private static final ReportComponent FILE_COMPONENT = ReportComponent.builder(Component.Type.FILE, 1) -- 2.39.5