Merge branch '3.1.x'

Closes gh-36493
pull/36503/head
Andy Wilkinson 1 year ago
commit 290ef3ccf6

@ -42,7 +42,7 @@ public class RedisProperties {
private int database = 0; private int database = 0;
/** /**
* Connection URL. Overrides host, port, and password. User is ignored. Example: * Connection URL. Overrides host, port, username, and password. Example:
* redis://user:password@example.com:6379 * redis://user:password@example.com:6379
*/ */
private String url; private String url;

@ -143,9 +143,9 @@ class RedisAutoConfigurationTests {
@Test @Test
void testOverrideUrlRedisConfiguration() { void testOverrideUrlRedisConfiguration() {
this.contextRunner this.contextRunner
.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.password:xyz", .withPropertyValues("spring.data.redis.host:foo", "spring.redis.data.user:alice",
"spring.data.redis.port:1000", "spring.data.redis.ssl.enabled:false", "spring.data.redis.password:xyz", "spring.data.redis.port:1000",
"spring.data.redis.url:rediss://user:password@example:33") "spring.data.redis.ssl.enabled:false", "spring.data.redis.url:rediss://user:password@example:33")
.run((context) -> { .run((context) -> {
LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getHostName()).isEqualTo("example");

Loading…
Cancel
Save