From 97b5acf9ab545bac06ef0ad4e1663fae97d24550 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 15 Sep 2020 13:54:04 +0200 Subject: [PATCH] DATAREDIS-1196 - Guard Tests that require Redis 6.0.6+ --- .../data/redis/core/DefaultListOperationsTests.java | 7 +++++++ .../redis/support/collections/AbstractRedisListTests.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/test/java/org/springframework/data/redis/core/DefaultListOperationsTests.java b/src/test/java/org/springframework/data/redis/core/DefaultListOperationsTests.java index 290eb97672..7bc74c1253 100644 --- a/src/test/java/org/springframework/data/redis/core/DefaultListOperationsTests.java +++ b/src/test/java/org/springframework/data/redis/core/DefaultListOperationsTests.java @@ -28,6 +28,7 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -37,6 +38,8 @@ import org.springframework.data.redis.RedisTestProfileValueSource; import org.springframework.data.redis.StringObjectFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.test.util.MinimumRedisVersionRule; +import org.springframework.test.annotation.IfProfileValue; /** * Integration test of {@link DefaultListOperations} @@ -50,6 +53,8 @@ @RunWith(Parameterized.class) public class DefaultListOperationsTests { + @Rule public MinimumRedisVersionRule redisVersion = new MinimumRedisVersionRule(); + private RedisTemplate redisTemplate; private ObjectFactory keyFactory; @@ -316,6 +321,7 @@ public void leftPushAllShouldThrowExceptionWhenCalledWithNull() { } @Test // DATAREDIS-1196 + @IfProfileValue(name = "redisVersion", value = "6.0.6+") public void indexOf() { K key = keyFactory.instance(); @@ -330,6 +336,7 @@ public void indexOf() { } @Test // DATAREDIS-1196 + @IfProfileValue(name = "redisVersion", value = "6.0.6+") @Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410") public void lastIndexOf() { diff --git a/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java index e8b1f5e419..ecec788b8a 100644 --- a/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java @@ -27,10 +27,13 @@ import org.assertj.core.api.Assumptions; import org.junit.Before; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; import org.springframework.data.redis.ObjectFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.test.util.MinimumRedisVersionRule; +import org.springframework.test.annotation.IfProfileValue; /** * Integration test for RedisList @@ -40,6 +43,8 @@ */ public abstract class AbstractRedisListTests extends AbstractRedisCollectionTests { + @Rule public MinimumRedisVersionRule redisVersion = new MinimumRedisVersionRule(); + protected RedisList list; /** @@ -161,6 +166,7 @@ public void addAllIndexCollectionMiddle() { } @Test // DATAREDIS-1196 + @IfProfileValue(name = "redisVersion", value = "6.0.6+") public void testIndexOfObject() { Assumptions.assumeThat(template.getConnectionFactory()).isInstanceOf(LettuceConnectionFactory.class); @@ -527,6 +533,7 @@ public void testTakeLast() { } @Test // DATAREDIS-1196 + @IfProfileValue(name = "redisVersion", value = "6.0.6+") @Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410") public void lastIndexOf() {