|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2017 the original author or authors.
|
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -91,6 +91,28 @@ public class RedisAutoConfigurationTests {
|
|
|
|
|
.isEqualTo(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPasswordInUrlWithColon() {
|
|
|
|
|
load("spring.redis.url:redis://:pass:word@example:33");
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getHostName())
|
|
|
|
|
.isEqualTo("example");
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getPort())
|
|
|
|
|
.isEqualTo(33);
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getPassword())
|
|
|
|
|
.isEqualTo("pass:word");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPasswordInUrlStartsWithColon() {
|
|
|
|
|
load("spring.redis.url:redis://user::pass:word@example:33");
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getHostName())
|
|
|
|
|
.isEqualTo("example");
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getPort())
|
|
|
|
|
.isEqualTo(33);
|
|
|
|
|
assertThat(this.context.getBean(JedisConnectionFactory.class).getPassword())
|
|
|
|
|
.isEqualTo(":pass:word");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testRedisConfigurationWithPool() throws Exception {
|
|
|
|
|
load("spring.redis.host:foo", "spring.redis.pool.max-idle:1");
|
|
|
|
|