-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed - Redis or Valkey hostname parsing. #3807
- Loading branch information
Nikita Koksharov
committed
Dec 5, 2024
1 parent
a0d9331
commit 621ec94
Showing
2 changed files
with
12 additions
and
0 deletions.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package org.redisson.misc; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
@@ -28,6 +29,13 @@ public void testIPv6Braces() { | |
assertThat(uri2.getPort()).isEqualTo(6379); | ||
} | ||
|
||
@Test | ||
public void testHostname() { | ||
Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> { | ||
new RedisURI("redis:///localhost:15319"); | ||
}, "Redis host can't be parsed"); | ||
} | ||
|
||
@Test | ||
public void testUsernamePassword() { | ||
RedisURI uri1 = new RedisURI("redis://user:[email protected]:15319"); | ||
|