|
|
|
|
@ -134,11 +134,14 @@ public class RedisAutoConfigurationJedisTests {
@@ -134,11 +134,14 @@ public class RedisAutoConfigurationJedisTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testRedisConfigurationWithPool() { |
|
|
|
|
this.contextRunner.withPropertyValues("spring.redis.host:foo", |
|
|
|
|
"spring.redis.jedis.pool.min-idle:1", |
|
|
|
|
"spring.redis.jedis.pool.max-idle:4", |
|
|
|
|
"spring.redis.jedis.pool.max-active:16", |
|
|
|
|
"spring.redis.jedis.pool.max-wait:2000").run((context) -> { |
|
|
|
|
this.contextRunner |
|
|
|
|
.withPropertyValues("spring.redis.host:foo", |
|
|
|
|
"spring.redis.jedis.pool.min-idle:1", |
|
|
|
|
"spring.redis.jedis.pool.max-idle:4", |
|
|
|
|
"spring.redis.jedis.pool.max-active:16", |
|
|
|
|
"spring.redis.jedis.pool.max-wait:2000", |
|
|
|
|
"spring.redis.jedis.pool.time-between-eviction-runs:30000") |
|
|
|
|
.run((context) -> { |
|
|
|
|
JedisConnectionFactory cf = context |
|
|
|
|
.getBean(JedisConnectionFactory.class); |
|
|
|
|
assertThat(cf.getHostName()).isEqualTo("foo"); |
|
|
|
|
@ -146,6 +149,8 @@ public class RedisAutoConfigurationJedisTests {
@@ -146,6 +149,8 @@ public class RedisAutoConfigurationJedisTests {
|
|
|
|
|
assertThat(cf.getPoolConfig().getMaxIdle()).isEqualTo(4); |
|
|
|
|
assertThat(cf.getPoolConfig().getMaxTotal()).isEqualTo(16); |
|
|
|
|
assertThat(cf.getPoolConfig().getMaxWaitMillis()).isEqualTo(2000); |
|
|
|
|
assertThat(cf.getPoolConfig().getTimeBetweenEvictionRunsMillis()) |
|
|
|
|
.isEqualTo(30000); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|