|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2023 the original author or authors. |
| 2 | + * Copyright 2012-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -152,18 +152,20 @@ void testPasswordInUrlStartsWithColon() {
|
152 | 152 | @Test
|
153 | 153 | void testRedisConfigurationWithPool() {
|
154 | 154 | 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", |
156 | 156 | "spring.data.redis.jedis.pool.max-idle:4", "spring.data.redis.jedis.pool.max-active:16",
|
157 | 157 | "spring.data.redis.jedis.pool.max-wait:2000",
|
158 | 158 | "spring.data.redis.jedis.pool.time-between-eviction-runs:30000")
|
159 | 159 | .run((context) -> {
|
160 | 160 | JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class);
|
161 | 161 | assertThat(cf.getHostName()).isEqualTo("foo");
|
162 |
| - assertThat(cf.getPoolConfig().getMinIdle()).isOne(); |
163 |
| - assertThat(cf.getPoolConfig().getMaxIdle()).isEqualTo(4); |
164 |
| - assertThat(cf.getPoolConfig().getMaxTotal()).isEqualTo(16); |
165 |
| - assertThat(cf.getPoolConfig().getMaxWaitDuration()).isEqualTo(Duration.ofSeconds(2)); |
166 |
| - assertThat(cf.getPoolConfig().getDurationBetweenEvictionRuns()).isEqualTo(Duration.ofSeconds(30)); |
| 162 | + assertThat(cf.getPoolConfig()).satisfies((poolConfig) -> { |
| 163 | + assertThat(poolConfig.getMinIdle()).isEqualTo(0); |
| 164 | + assertThat(poolConfig.getMaxIdle()).isEqualTo(4); |
| 165 | + assertThat(poolConfig.getMaxTotal()).isEqualTo(16); |
| 166 | + assertThat(poolConfig.getMaxWaitDuration()).isEqualTo(Duration.ofSeconds(2)); |
| 167 | + assertThat(poolConfig.getDurationBetweenEvictionRuns()).isEqualTo(Duration.ofSeconds(30)); |
| 168 | + }); |
167 | 169 | });
|
168 | 170 | }
|
169 | 171 |
|
|
0 commit comments