Example usage for org.springframework.data.redis.connection.lettuce DefaultLettucePool DefaultLettucePool

List of usage examples for org.springframework.data.redis.connection.lettuce DefaultLettucePool DefaultLettucePool

Introduction

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

Prototype

public DefaultLettucePool(RedisSentinelConfiguration sentinelConfiguration) 

Source Link

Document

Uses the RedisSentinelConfiguration and RedisClient defaults for configuring the connection pool based on sentinels.

Usage

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

/**
 * @see DATAREDIS-524// w  w  w. ja va 2s  .  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())));
}