diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java index 7cf4013e0..109604992 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java @@ -177,14 +177,17 @@ public class JedisClusterConnection implements DefaultedRedisClusterConnection { } /** - * Execute the given command for the {@code key} provided potentially appending args.
+ * Execute the given command for each key in {@code keys} provided appending all {@code args} on each invocation. + *
* This method, other than {@link #execute(String, byte[]...)}, dispatches the command to the {@code key} serving - * master node. + * master node and appends the {@code key} as first command argument to the {@code command}. {@code keys} are not + * required to share the same slot for single-key commands. Multi-key commands carrying their keys in {@code args} + * still require to share the same slot as the {@code key}. * *
 	 * 
 	 * // SET foo bar EX 10 NX
-	 * execute("SET", "foo".getBytes(), asBinaryList("bar", "EX", 10, "NX")
+	 * execute("SET", "foo".getBytes(), asBinaryList("bar", "EX", 10, "NX"))
 	 * 
 	 * 
* @@ -860,7 +863,8 @@ public class JedisClusterConnection implements DefaultedRedisClusterConnection { PropertyAccessor accessor = new DirectFieldAccessFallbackBeanWrapper(cluster); this.connectionHandler = accessor.isReadableProperty("connectionHandler") - ? (JedisClusterConnectionHandler) accessor.getPropertyValue("connectionHandler") : null; + ? (JedisClusterConnectionHandler) accessor.getPropertyValue("connectionHandler") + : null; } else { this.connectionHandler = null; } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java index 2b840add5..e89450e92 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java @@ -165,7 +165,7 @@ class LettuceKeyCommands implements RedisKeyCommands { return null; } if (isQueueing()) { - transaction(connection.newLettuceTxResult(getConnection().touch(keys))); + transaction(connection.newLettuceResult(getAsyncConnection().touch(keys))); return null; } return getConnection().touch(keys); 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 44746b6aa..91f1f147f 100644 --- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -69,9 +69,7 @@ import org.springframework.data.redis.core.ScanOptions; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.types.Expiration; import org.springframework.data.redis.core.types.RedisClientInfo; -import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializer; -import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.data.redis.test.util.RedisClientRule; import org.springframework.data.redis.test.util.RedisDriver; import org.springframework.data.redis.test.util.WithRedisDriver; @@ -2778,11 +2776,10 @@ public abstract class AbstractConnectionIntegrationTests { @Test // DATAREDIS-694 public void touchReturnsNrOfKeysTouched() { - connection.set("touch.this", "Can't touch this! - oh-oh oh oh oh-oh-oh"); - + actual.add(connection.set("touch.this", "Can't touch this! - oh-oh oh oh oh-oh-oh")); actual.add(connection.touch("touch.this", "touch.that")); - verifyResults(Arrays.asList(new Object[] { 1L })); + verifyResults(Arrays.asList(new Object[] { Boolean.TRUE, 1L })); } @Test // DATAREDIS-694