Skip to content

Commit 911a9a1

Browse files
hezeansnicoll
authored andcommitted
Prevent redis pool to initialize in unit test
See gh-43774 Signed-off-by: He Zean <realhezean@gmail.com>
1 parent 15b63fa commit 911a9a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ void testPasswordInUrlStartsWithColon() {
152152
@Test
153153
void testRedisConfigurationWithPool() {
154154
this.contextRunner
155-
.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.min-idle:1",
155+
.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.min-idle:0",
156156
"spring.data.redis.jedis.pool.max-idle:4", "spring.data.redis.jedis.pool.max-active:16",
157157
"spring.data.redis.jedis.pool.max-wait:2000",
158158
"spring.data.redis.jedis.pool.time-between-eviction-runs:30000")
159159
.run((context) -> {
160160
JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class);
161161
assertThat(cf.getHostName()).isEqualTo("foo");
162-
assertThat(cf.getPoolConfig().getMinIdle()).isOne();
162+
assertThat(cf.getPoolConfig().getMinIdle()).isZero();
163163
assertThat(cf.getPoolConfig().getMaxIdle()).isEqualTo(4);
164164
assertThat(cf.getPoolConfig().getMaxTotal()).isEqualTo(16);
165165
assertThat(cf.getPoolConfig().getMaxWaitDuration()).isEqualTo(Duration.ofSeconds(2));

0 commit comments

Comments
 (0)