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 7e6c1f67ac2 Add test cases for GlobalNodePath (#32457)
7e6c1f67ac2 is described below
commit 7e6c1f67ac22e2adde9f0c4920d9bdac57b06a5f
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Aug 10 21:14:09 2024 +0800
Add test cases for GlobalNodePath (#32457)
---
.../org/apache/shardingsphere/mode/path/GlobalNodePathTest.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/mode/api/src/test/java/org/apache/shardingsphere/mode/path/GlobalNodePathTest.java
b/mode/api/src/test/java/org/apache/shardingsphere/mode/path/GlobalNodePathTest.java
index 53c5db0d6a2..89c460fd2d4 100644
---
a/mode/api/src/test/java/org/apache/shardingsphere/mode/path/GlobalNodePathTest.java
+++
b/mode/api/src/test/java/org/apache/shardingsphere/mode/path/GlobalNodePathTest.java
@@ -23,6 +23,7 @@ import java.util.Optional;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class GlobalNodePathTest {
@@ -50,4 +51,10 @@ class GlobalNodePathTest {
assertTrue(actual.isPresent());
assertThat(actual.get(), is("transaction"));
}
+
+ @Test
+ void assertGetRuleNameWhenNotFound() {
+ Optional<String> actual =
GlobalNodePath.getRuleName("/invalid/transaction/active_version");
+ assertFalse(actual.isPresent());
+ }
}