DATAREDIS-480 - Polishing.
Add missing author tag. Minor reformatting. Explicitly set default SSL options and add test to verify default SSL options. Enhance JavaDoc. Original pull request: #180.
This commit is contained in:
@@ -37,6 +37,7 @@ import com.lambdaworks.redis.cluster.RedisClusterClient;
|
||||
/**
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author Balázs Németh
|
||||
*/
|
||||
public class LettuceConnectionFactoryUnitTests {
|
||||
|
||||
@@ -129,6 +130,30 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(client, instanceOf(RedisClusterClient.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-480
|
||||
*/
|
||||
@Test
|
||||
public void sslOptionsShouldBeDisabledByDefaultOnClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
|
||||
connectionFactory.setClientResources(LettuceTestClientResources.getSharedClientResources());
|
||||
connectionFactory.afterPropertiesSet();
|
||||
ConnectionFactoryTracker.add(connectionFactory);
|
||||
|
||||
AbstractRedisClient client = (AbstractRedisClient) getField(connectionFactory, "client");
|
||||
assertThat(client, instanceOf(RedisClient.class));
|
||||
|
||||
RedisURI redisUri = (RedisURI) getField(client, "redisURI");
|
||||
|
||||
assertThat(redisUri.isSsl(), is(false));
|
||||
assertThat(connectionFactory.isUseSsl(), is(false));
|
||||
assertThat(redisUri.isStartTls(), is(false));
|
||||
assertThat(connectionFactory.isStartTls(), is(false));
|
||||
assertThat(redisUri.isVerifyPeer(), is(true));
|
||||
assertThat(connectionFactory.isVerifyPeer(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-476
|
||||
*/
|
||||
@@ -148,6 +173,8 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
|
||||
assertThat(redisUri.isSsl(), is(true));
|
||||
assertThat(connectionFactory.isUseSsl(), is(true));
|
||||
assertThat(redisUri.isVerifyPeer(), is(true));
|
||||
assertThat(connectionFactory.isVerifyPeer(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user