]> source.dussan.org Git - sonarqube.git/commitdiff
Do not recreate UuidFactory for DbTester
authorJacek <jacek.poreda@sonarsource.com>
Thu, 16 Apr 2020 11:52:06 +0000 (13:52 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 25 May 2020 20:05:18 +0000 (20:05 +0000)
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java

index d56635b89400abc1a231fad91862969d839251a2..fba9a7404c93d6564f631115653fc227d0bf281d 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.commons.lang.StringUtils;
 import org.picocontainer.containers.TransientPicoContainer;
 import org.sonar.api.utils.System2;
 import org.sonar.core.util.SequenceUuidFactory;
+import org.sonar.core.util.UuidFactory;
 import org.sonar.db.alm.AlmDbTester;
 import org.sonar.db.alm.integration.pat.AlmPatsDbTester;
 import org.sonar.db.almsettings.AlmSettingsDbTester;
@@ -68,6 +69,7 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
  */
 public class DbTester extends AbstractDbTester<TestDbImpl> {
 
+  private final UuidFactory uuidFactory = new SequenceUuidFactory();
   private final System2 system2;
   private DbClient client;
   private DbSession session = null;
@@ -158,7 +160,7 @@ public class DbTester extends AbstractDbTester<TestDbImpl> {
     TransientPicoContainer ioc = new TransientPicoContainer();
     ioc.addComponent(db.getMyBatis());
     ioc.addComponent(system2);
-    ioc.addComponent(new SequenceUuidFactory());
+    ioc.addComponent(uuidFactory);
     for (Class daoClass : DaoModule.classes()) {
       ioc.addComponent(daoClass);
     }