From 26fc907558cefd2fbc36579fa3bfb6a719565123 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 2 Jul 2024 10:55:13 -0400 Subject: [PATCH] Fix `JdbcLockRegistryTests.testTwoThreadsDifferentRegistries()` The test is supposed to verify against different clients, but same DB --- .../integration/jdbc/lock/JdbcLockRegistryTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java index e5ccbb8309..85879f923a 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java @@ -251,7 +251,11 @@ public class JdbcLockRegistryTests { for (int i = 0; i < 100; i++) { final JdbcLockRegistry registry1 = new JdbcLockRegistry(this.client); - final JdbcLockRegistry registry2 = new JdbcLockRegistry(this.client); + DefaultLockRepository client2 = new DefaultLockRepository(this.dataSource); + client2.setTransactionManager(this.transactionManager); + client2.afterPropertiesSet(); + client2.afterSingletonsInstantiated(); + final JdbcLockRegistry registry2 = new JdbcLockRegistry(client2); final Lock lock1 = registry1.obtain("foo"); final AtomicBoolean locked = new AtomicBoolean(); final CountDownLatch latch1 = new CountDownLatch(1);