@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 201 8 the original author or authors .
* Copyright 2012 - 201 9 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 .
@ -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 {
assertThat ( cf . getPoolConfig ( ) . getMaxIdle ( ) ) . isEqualTo ( 4 ) ;
assertThat ( cf . getPoolConfig ( ) . getMaxTotal ( ) ) . isEqualTo ( 16 ) ;
assertThat ( cf . getPoolConfig ( ) . getMaxWaitMillis ( ) ) . isEqualTo ( 2000 ) ;
assertThat ( cf . getPoolConfig ( ) . getTimeBetweenEvictionRunsMillis ( ) )
. isEqualTo ( 30000 ) ;
} ) ;
}