diff --git a/pom.xml b/pom.xml index 3289a2e7e4..2b7efb2f4a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 org.springframework.data spring-data-redis - 2.4.0-SNAPSHOT + 2.4.0-DATAREDIS-1234-SNAPSHOT Spring Data Redis diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java index 1d51b32a21..a28563de6f 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java @@ -83,7 +83,8 @@ public List lPos(byte[] key, byte[] element, @Nullable Integer rank, @Null if (count != null) { pipeline(connection.newLettuceResult(getAsyncConnection().lpos(key, element, count, args))); } else { - pipeline(connection.newLettuceResult(getAsyncConnection().lpos(key, element, args))); + pipeline( + connection.newLettuceResult(getAsyncConnection().lpos(key, element, args), Collections::singletonList)); } return null; } @@ -91,7 +92,8 @@ public List lPos(byte[] key, byte[] element, @Nullable Integer rank, @Null if (count != null) { transaction(connection.newLettuceResult(getAsyncConnection().lpos(key, element, count, args))); } else { - transaction(connection.newLettuceResult(getAsyncConnection().lpos(key, element, args))); + transaction( + connection.newLettuceResult(getAsyncConnection().lpos(key, element, args), Collections::singletonList)); } return null; } diff --git a/src/test/java/org/springframework/data/redis/RedisTestProfileValueSource.java b/src/test/java/org/springframework/data/redis/RedisTestProfileValueSource.java index 50d5a14404..9d55c72fad 100644 --- a/src/test/java/org/springframework/data/redis/RedisTestProfileValueSource.java +++ b/src/test/java/org/springframework/data/redis/RedisTestProfileValueSource.java @@ -42,6 +42,7 @@ public class RedisTestProfileValueSource implements ProfileValueSource { private static final String REDIS_32 = "3.2"; private static final String REDIS_50 = "5.0"; private static final String REDIS_60 = "6.0"; + private static final String REDIS_606 = "6.0.6"; private static final String REDIS_VERSION_KEY = "redisVersion"; private static RedisTestProfileValueSource INSTANCE; @@ -98,6 +99,10 @@ public String get(String key) { return System.getProperty(key); } + if (redisVersion.compareTo(RedisVersionUtils.parseVersion(REDIS_606)) >= 0) { + return REDIS_606; + } + if (redisVersion.compareTo(RedisVersionUtils.parseVersion(REDIS_60)) >= 0) { return REDIS_60; } diff --git a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java index 2344d131e4..76751eb6ad 100644 --- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -1501,9 +1501,9 @@ public void testLPushMultiple() { public void lPos() { actual.add(connection.rPush("mylist", "a", "b", "c", "1", "2", "3", "c", "c")); - actual.add(connection.lPos("mylist", "c")); + actual.add(connection.lPos("mylist", "c", null, null)); - assertThat((Long) getResults().get(1)).isEqualTo(2); + assertThat((List) getResults().get(1)).containsOnly(2L); } @Test // DATAREDIS-1196