This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 65be88667bb Add test cases for ListenerAssistedNodePath (#32456)
65be88667bb is described below
commit 65be88667bbc39c06906c549d5d4477d533a6539
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Aug 10 19:19:43 2024 +0800
Add test cases for ListenerAssistedNodePath (#32456)
---
.../shardingsphere/mode/path/ListenerAssistedNodePathTest.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/mode/api/src/test/java/org/apache/shardingsphere/mode/path/ListenerAssistedNodePathTest.java
b/mode/api/src/test/java/org/apache/shardingsphere/mode/path/ListenerAssistedNodePathTest.java
index e21cc563544..1b88218e94c 100644
---
a/mode/api/src/test/java/org/apache/shardingsphere/mode/path/ListenerAssistedNodePathTest.java
+++
b/mode/api/src/test/java/org/apache/shardingsphere/mode/path/ListenerAssistedNodePathTest.java
@@ -24,6 +24,7 @@ import java.util.Optional;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class ListenerAssistedNodePathTest {
@@ -40,6 +41,12 @@ class ListenerAssistedNodePathTest {
assertThat(actual.get(), Matchers.is("foo_db"));
}
+ @Test
+ void assertGetDatabaseNameWhenNotFound() {
+ Optional<String> actual =
ListenerAssistedNodePath.getDatabaseName("/invalid/foo_db");
+ assertFalse(actual.isPresent());
+ }
+
@Test
void assertGetDatabaseNameNodePath() {
assertThat(ListenerAssistedNodePath.getDatabaseNameNodePath("foo_db"),
is("/listener_assisted/foo_db"));