From: Jacek Date: Thu, 16 Apr 2020 11:52:06 +0000 (+0200) Subject: Do not recreate UuidFactory for DbTester X-Git-Tag: 8.4.0.35506~193 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=85a8f41b50a3721461d06f49b0b13d85bafd6edc;p=sonarqube.git Do not recreate UuidFactory for DbTester --- diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java index d56635b8940..fba9a7404c9 100644 --- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java +++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java @@ -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 { + 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 { 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); }