DATAREDIS-315 - Support password protected Redis Cluster.

Add new config property to configure a password for operations with Redis Cluster. The only driver to support Redis Cluster with password is lettuce but 3.4.Final has a blocker bug that prevents the usage

Original pull request: #158.
This commit is contained in:
Mark Paluch
2016-02-04 15:32:57 +01:00
parent f18def013a
commit 0ac118fcc0
5 changed files with 80 additions and 6 deletions

View File

@@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
/**
* @author Christoph Strobl
* @author Mark Paluch
*/
public class RedisClusterConfigurationUnitTests {
@@ -125,12 +126,14 @@ public class RedisClusterConfigurationUnitTests {
propertySource.setProperty("spring.redis.cluster.timeout", "10");
propertySource.setProperty("spring.redis.cluster.nodes", HOST_AND_PORT_1);
propertySource.setProperty("spring.redis.cluster.max-redirects", "5");
propertySource.setProperty("spring.redis.cluster.password", "foobar");
RedisClusterConfiguration config = new RedisClusterConfiguration(propertySource);
assertThat(config.getMaxRedirects(), is(5));
assertThat(config.getClusterTimeout(), is(10L));
assertThat(config.getClusterNodes(), hasItems(new RedisNode("127.0.0.1", 123)));
assertThat(config.getPassword(), is("foobar"));
}
/**