You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/02/06 15:52:55 UTC
(shardingsphere) branch master updated: Refactor NamedRuleItemNodePathTest (#34581)
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 a3fcdef48a1 Refactor NamedRuleItemNodePathTest (#34581)
a3fcdef48a1 is described below
commit a3fcdef48a1571163c9391bc0d515b4f123abed8
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Feb 6 23:52:48 2025 +0800
Refactor NamedRuleItemNodePathTest (#34581)
---
.../path/config/rule/item/NamedRuleItemNodePathTest.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/rule/item/NamedRuleItemNodePathTest.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/rule/item/NamedRuleItemNodePathTest.java
index 7f104b8ec89..db22f278ccd 100644
--- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/rule/item/NamedRuleItemNodePathTest.java
+++ b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/rule/item/NamedRuleItemNodePathTest.java
@@ -29,48 +29,48 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
class NamedRuleItemNodePathTest {
- private final NamedRuleItemNodePath converter = new NamedRuleItemNodePath(new RuleRootNodePath("foo"), "tables");
+ private final NamedRuleItemNodePath nodePath = new NamedRuleItemNodePath(new RuleRootNodePath("foo"), "tables");
@Test
void assertGetPath() {
- assertThat(converter.getPath("foo_tbl"), is("tables/foo_tbl"));
+ assertThat(nodePath.getPath("foo_tbl"), is("tables/foo_tbl"));
}
@Test
void assertFindName() {
- Optional<String> actual = converter.findName("/metadata/foo_db/rules/foo/tables/foo_tbl/versions/0");
+ Optional<String> actual = nodePath.findName("/metadata/foo_db/rules/foo/tables/foo_tbl/versions/0");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("foo_tbl"));
}
@Test
void assertFindNameWithInvalidPath() {
- assertFalse(converter.findName("/metadata/foo_db/rules/bar/tables/foo_tbl/versions/0").isPresent());
+ assertFalse(nodePath.findName("/metadata/foo_db/rules/bar/tables/foo_tbl/versions/0").isPresent());
}
@Test
void assertFindNameByActiveVersion() {
- Optional<String> actual = converter.findNameByActiveVersion("/metadata/foo_db/rules/foo/tables/foo_tbl/active_version");
+ Optional<String> actual = nodePath.findNameByActiveVersion("/metadata/foo_db/rules/foo/tables/foo_tbl/active_version");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("foo_tbl"));
}
@Test
void assertFindNameByActiveVersionWhenNotFound() {
- Optional<String> actual = converter.findNameByActiveVersion("/invalid");
+ Optional<String> actual = nodePath.findNameByActiveVersion("/invalid");
assertFalse(actual.isPresent());
}
@Test
void assertFindNameByItemPath() {
- Optional<String> actual = converter.findNameByItemPath("/metadata/foo_db/rules/foo/tables/foo_tbl");
+ Optional<String> actual = nodePath.findNameByItemPath("/metadata/foo_db/rules/foo/tables/foo_tbl");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("foo_tbl"));
}
@Test
void assertNotFindNameByItemPath() {
- Optional<String> actual = converter.findNameByItemPath("/metadata/foo_db/rules/foo/tables/foo_tbl/xxx");
+ Optional<String> actual = nodePath.findNameByItemPath("/metadata/foo_db/rules/foo/tables/foo_tbl/xxx-xxx");
assertFalse(actual.isPresent());
}
}