From 85a8f41b50a3721461d06f49b0b13d85bafd6edc Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 16 Apr 2020 13:52:06 +0200 Subject: [PATCH] Do not recreate UuidFactory for DbTester --- .../src/testFixtures/java/org/sonar/db/DbTester.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.39.5