Example usage for org.springframework.data.redis.connection.lettuce LettuceConnectionFactory isUseSsl

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

Introduction

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

Prototype

public boolean isUseSsl() 

Source Link

Document

Returns whether to use SSL.

Usage

From source file:org.springframework.boot.autoconfigure.data.redis.RedisAutoConfigurationTests.java

@Test
public void testOverrideRedisConfiguration() {
    this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.database:1",
            "spring.redis.lettuce.shutdown-timeout:500").run((context) -> {
                LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
                assertThat(cf.getHostName()).isEqualTo("foo");
                assertThat(cf.getDatabase()).isEqualTo(1);
                assertThat(cf.getPassword()).isNull();
                assertThat(cf.isUseSsl()).isFalse();
                assertThat(cf.getShutdownTimeout()).isEqualTo(500);
            });/*  ww  w .j  a  v a2 s. c  o  m*/
}

From source file:org.springframework.boot.autoconfigure.data.redis.RedisAutoConfigurationTests.java

@Test
public void testCustomizeRedisConfiguration() {
    this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> {
        LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
        assertThat(cf.isUseSsl()).isTrue();
    });/*from www  .  java2 s.  co  m*/
}

From source file:org.springframework.boot.autoconfigure.data.redis.RedisAutoConfigurationTests.java

@Test
public void testRedisUrlConfiguration() {
    this.contextRunner
            .withPropertyValues("spring.redis.host:foo", "spring.redis.url:redis://user:password@example:33")
            .run((context) -> {//from   w w  w .  ja  v a 2  s.  c  om
                LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
                assertThat(cf.getHostName()).isEqualTo("example");
                assertThat(cf.getPort()).isEqualTo(33);
                assertThat(cf.getPassword()).isEqualTo("password");
                assertThat(cf.isUseSsl()).isFalse();
            });
}

From source file:org.springframework.boot.autoconfigure.data.redis.RedisAutoConfigurationTests.java

@Test
public void testOverrideUrlRedisConfiguration() {
    this.contextRunner
            .withPropertyValues("spring.redis.host:foo", "spring.redis.password:xyz", "spring.redis.port:1000",
                    "spring.redis.ssl:false", "spring.redis.url:rediss://user:password@example:33")
            .run((context) -> {//from   w  w w . j a  v  a 2 s .c om
                LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
                assertThat(cf.getHostName()).isEqualTo("example");
                assertThat(cf.getPort()).isEqualTo(33);
                assertThat(cf.getPassword()).isEqualTo("password");
                assertThat(cf.isUseSsl()).isTrue();
            });
}