Skip to content

Commit

Permalink
Merge pull request spring-projects#36477 from izeye
Browse files Browse the repository at this point in the history
* spring-projectsgh-36477:
  Polish "Correct description of overrides for spring.redis.url"
  Correct description of overrides for spring.redis.url

Closes spring-projectsgh-36477
  • Loading branch information
wilkinsona committed Jul 21, 2023
2 parents 1b34292 + 5a0f1bb commit 0d77347
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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 @@ -41,7 +41,7 @@ public class RedisProperties {
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:[email protected]:6379
*/
private String url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ void testRedisUrlConfiguration() {
@Test
void testOverrideUrlRedisConfiguration() {
this.contextRunner
.withPropertyValues("spring.redis.host:foo", "spring.redis.password:xyz", "spring.redis.port:1000",
"spring.redis.ssl:false", "spring.redis.url:rediss://user:password@example:33")
.withPropertyValues("spring.redis.host:foo", "spring.redis.user:alice", "spring.redis.password:xyz",
"spring.redis.port:1000", "spring.redis.ssl:false",
"spring.redis.url:rediss://user:password@example:33")
.run((context) -> {
LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class);
assertThat(cf.getHostName()).isEqualTo("example");
Expand Down

0 comments on commit 0d77347

Please sign in to comment.