Skip to content

Commit 79d31b2

Browse files
committed
Remove ulinkAvailable test for RedisLockRegistry
The logic of the test does not reflect the state of the `RedisLockRegistry` around `ulinkAvailable` property: we don't check the Redis version anymore, but try to call `UNLINK` command. Then we reset `ulinkAvailable` to `false` to call regular `DEL` for the rest of `RedisLockRegistry` life The `RedisAvailableRule` marks `testUlink()` as passed even without calling it. We are not going to look into fixing the rule since we are migrating to Testcontainers: spring-projects#3840
1 parent 7f631fc commit 79d31b2

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
21-
import static org.mockito.ArgumentMatchers.any;
22-
import static org.mockito.BDDMockito.willReturn;
23-
import static org.mockito.Mockito.mock;
2421

2522
import java.util.Collection;
2623
import java.util.List;
2724
import java.util.Map;
28-
import java.util.Properties;
2925
import java.util.Queue;
3026
import java.util.UUID;
3127
import java.util.concurrent.Callable;
@@ -53,8 +49,6 @@
5349
import org.junit.runners.Parameterized.Parameters;
5450

5551
import org.springframework.data.redis.connection.RedisConnectionFactory;
56-
import org.springframework.data.redis.core.RedisCallback;
57-
import org.springframework.data.redis.core.RedisOperations;
5852
import org.springframework.data.redis.core.StringRedisTemplate;
5953
import org.springframework.integration.redis.rules.RedisAvailable;
6054
import org.springframework.integration.redis.rules.RedisAvailableTests;
@@ -797,23 +791,6 @@ public void earlyWakeUpTest() throws InterruptedException {
797791
executorService.shutdown();
798792
}
799793

800-
801-
@SuppressWarnings({ "unchecked", "rawtypes" })
802-
@Test
803-
public void testUlink() {
804-
RedisOperations ops = mock(RedisOperations.class);
805-
Properties props = new Properties();
806-
willReturn(props).given(ops).execute(any(RedisCallback.class));
807-
props.setProperty("redis_version", "3.0.0");
808-
RedisLockRegistry registry = new RedisLockRegistry(mock(RedisConnectionFactory.class), "foo");
809-
registry.setRedisLockType(testRedisLockType);
810-
assertThat(TestUtils.getPropertyValue(registry, "ulinkAvailable", Boolean.class)).isFalse();
811-
props.setProperty("redis_version", "4.0.0");
812-
registry = new RedisLockRegistry(mock(RedisConnectionFactory.class), "foo");
813-
registry.setRedisLockType(testRedisLockType);
814-
assertThat(TestUtils.getPropertyValue(registry, "ulinkAvailable", Boolean.class)).isTrue();
815-
}
816-
817794
private Long getExpire(RedisLockRegistry registry, String lockKey) {
818795
StringRedisTemplate template = createTemplate();
819796
String registryKey = TestUtils.getPropertyValue(registry, "registryKey", String.class);

0 commit comments

Comments
 (0)