Skip to content

Commit

Permalink
Merge branch '3.4.x'
Browse files Browse the repository at this point in the history
Closes gh-43776
  • Loading branch information
snicoll committed Jan 11, 2025
2 parents d1678de + e061bb4 commit ae83f7e
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand Down Expand Up @@ -152,18 +152,20 @@ void testPasswordInUrlStartsWithColon() {
@Test
void testRedisConfigurationWithPool() {
this.contextRunner
.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.min-idle:1",
.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.min-idle:0",
"spring.data.redis.jedis.pool.max-idle:4", "spring.data.redis.jedis.pool.max-active:16",
"spring.data.redis.jedis.pool.max-wait:2000",
"spring.data.redis.jedis.pool.time-between-eviction-runs:30000")
.run((context) -> {
JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class);
assertThat(cf.getHostName()).isEqualTo("foo");
assertThat(cf.getPoolConfig().getMinIdle()).isOne();
assertThat(cf.getPoolConfig().getMaxIdle()).isEqualTo(4);
assertThat(cf.getPoolConfig().getMaxTotal()).isEqualTo(16);
assertThat(cf.getPoolConfig().getMaxWaitDuration()).isEqualTo(Duration.ofSeconds(2));
assertThat(cf.getPoolConfig().getDurationBetweenEvictionRuns()).isEqualTo(Duration.ofSeconds(30));
assertThat(cf.getPoolConfig()).satisfies((poolConfig) -> {
assertThat(poolConfig.getMinIdle()).isEqualTo(0);
assertThat(poolConfig.getMaxIdle()).isEqualTo(4);
assertThat(poolConfig.getMaxTotal()).isEqualTo(16);
assertThat(poolConfig.getMaxWaitDuration()).isEqualTo(Duration.ofSeconds(2));
assertThat(poolConfig.getDurationBetweenEvictionRuns()).isEqualTo(Duration.ofSeconds(30));
});
});
}

Expand Down

0 comments on commit ae83f7e

Please sign in to comment.