Skip to content

Commit 26fc907

Browse files
committed
Fix JdbcLockRegistryTests.testTwoThreadsDifferentRegistries()
The test is supposed to verify against different clients, but same DB
1 parent a3fb68a commit 26fc907

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ public void testTwoThreadsDifferentRegistries() throws Exception {
251251
for (int i = 0; i < 100; i++) {
252252

253253
final JdbcLockRegistry registry1 = new JdbcLockRegistry(this.client);
254-
final JdbcLockRegistry registry2 = new JdbcLockRegistry(this.client);
254+
DefaultLockRepository client2 = new DefaultLockRepository(this.dataSource);
255+
client2.setTransactionManager(this.transactionManager);
256+
client2.afterPropertiesSet();
257+
client2.afterSingletonsInstantiated();
258+
final JdbcLockRegistry registry2 = new JdbcLockRegistry(client2);
255259
final Lock lock1 = registry1.obtain("foo");
256260
final AtomicBoolean locked = new AtomicBoolean();
257261
final CountDownLatch latch1 = new CountDownLatch(1);

0 commit comments

Comments
 (0)