-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ERR invalid password when creating a RedisURI with a username #131
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,22 @@ public void redisFromUrl() throws Exception { | |
assertThat(result.isSsl()).isFalse(); | ||
} | ||
|
||
@Test | ||
public void redisFromUrlNoPassword() throws Exception { | ||
RedisURI redisURI = RedisURI.create("redis://localhost:1234/5"); | ||
assertThat(redisURI.getPassword()).isNull(); | ||
|
||
redisURI = RedisURI.create("redis://h:@localhost.com:14589"); | ||
assertThat(redisURI.getPassword()).isNull(); | ||
|
||
} | ||
|
||
@Test | ||
public void redisFromUrlPassword() throws Exception { | ||
RedisURI redisURI = RedisURI.create("redis://h:[email protected]:14589"); | ||
assertThat(redisURI.getPassword()).isEqualTo("password".toCharArray()); | ||
} | ||
|
||
@Test | ||
public void redisSslFromUrl() throws Exception { | ||
RedisURI result = RedisURI.create(RedisURI.URI_SCHEME_REDIS_SECURE + "://:password@localhost/1"); | ||
|
@@ -129,4 +145,5 @@ public void redisSocketWithPassword() throws Exception { | |
assertThat(result.getPort()).isEqualTo(0); | ||
assertThat(result.isSsl()).isFalse(); | ||
} | ||
|
||
} |