Skip to content

Commit 68d5052

Browse files
committed
Fix RedisLockRegistryTests for Lock type
The `DistributedLock` type has been introduced in newer version
1 parent 684e481 commit 68d5052

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,13 +1075,13 @@ void sharedDelegateIsDeletedFromRedisOnUnlock() throws Exception {
10751075

10761076
// Find two distinct lock keys that share the same ReentrantLock (same DefaultLockRegistry slot)
10771077
String keyB = null;
1078-
DistributedLock lockA = null;
1079-
DistributedLock lockB = null;
1078+
Lock lockA = null;
1079+
Lock lockB = null;
10801080
outer:
10811081
for (int i = 0; i < 10; i++) {
10821082
for (int j = i + 1; j < 10; j++) {
1083-
DistributedLock la = registry1.obtain("key-" + i);
1084-
DistributedLock lb = registry1.obtain("key-" + j);
1083+
Lock la = registry1.obtain("key-" + i);
1084+
Lock lb = registry1.obtain("key-" + j);
10851085
if (TestUtils.getPropertyValue(la, "localLock") == TestUtils.getPropertyValue(lb, "localLock")) {
10861086
keyB = "key-" + j;
10871087
lockA = la;
@@ -1102,7 +1102,7 @@ void sharedDelegateIsDeletedFromRedisOnUnlock() throws Exception {
11021102
lockB.unlock();
11031103

11041104
// Another process must be able to acquire keyB immediately (its Redis key must be deleted)
1105-
DistributedLock lockBOtherProcess = registry2.obtain(keyB);
1105+
Lock lockBOtherProcess = registry2.obtain(keyB);
11061106
assertThat(lockBOtherProcess.tryLock(500, TimeUnit.MILLISECONDS))
11071107
.as("Redis key for '" + keyB + "' was not deleted on unlock — orphaned lock detected")
11081108
.isTrue();

0 commit comments

Comments
 (0)