Example usage for org.springframework.data.redis.connection RedisSentinelConfiguration RedisSentinelConfiguration

List of usage examples for org.springframework.data.redis.connection RedisSentinelConfiguration RedisSentinelConfiguration

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisSentinelConfiguration RedisSentinelConfiguration.

Prototype

public RedisSentinelConfiguration(String master, Set<String> sentinelHostAndPorts) 

Source Link

Document

Creates RedisSentinelConfiguration for given hostPort combinations.

Usage

From source file:org.springframework.data.redis.connection.lettuce.DefaultLettucePoolTests.java

/**
 * @see DATAREDIS-524//from w w w.  j  a  v a 2 s  .  c  om
 */
@Test
public void testCreateSentinelWithPassword() {

    pool = new DefaultLettucePool(
            new RedisSentinelConfiguration("mymaster", Collections.singleton("host:1234")));
    pool.setClientResources(LettuceTestClientResources.getSharedClientResources());
    pool.setPassword("foo");
    pool.afterPropertiesSet();

    RedisURI redisUri = (RedisURI) getField(pool.getClient(), "redisURI");

    assertThat(redisUri.getPassword(), is(equalTo(pool.getPassword().toCharArray())));
}