You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2023/06/27 08:30:10 UTC
[shardingsphere] branch master updated: Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder (#26618)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 dc3156ebda6 Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder (#26618)
dc3156ebda6 is described below
commit dc3156ebda67808ee9da476ae072ca90ab810391
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Jun 27 16:30:04 2023 +0800
Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder (#26618)
* Refactor YamlDataNode
* Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder
---
.../NewYamlBroadcastRuleConfigurationSwapperTest.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/features/broadcast/core/src/main/test/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java
similarity index 89%
rename from features/broadcast/core/src/main/test/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java
rename to features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java
index a8e7f096706..5008e8fbb20 100644
--- a/features/broadcast/core/src/main/test/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java
+++ b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java
@@ -21,6 +21,7 @@ import org.apache.shardingsphere.broadcast.api.config.BroadcastRuleConfiguration
import org.apache.shardingsphere.infra.util.yaml.datanode.YamlDataNode;
import org.junit.jupiter.api.Test;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
@@ -51,11 +52,7 @@ class NewYamlBroadcastRuleConfigurationSwapperTest {
}
private BroadcastRuleConfiguration createMaximumBroadcastRule() {
- Collection<String> tables = new LinkedList<>();
- tables.add(("foo_table"));
- tables.add(("foo_table2"));
- BroadcastRuleConfiguration result = new BroadcastRuleConfiguration(tables);
- return result;
+ return new BroadcastRuleConfiguration(Arrays.asList("foo_table", "foo_table2"));
}
@Test
@@ -68,9 +65,9 @@ class NewYamlBroadcastRuleConfigurationSwapperTest {
@Test
void assertSwapToObject() {
Collection<YamlDataNode> config = new LinkedList<>();
- config.add(new YamlDataNode("/metadata/foo_db/rules/broadcast/tables", "tables:\n" +
- "- foo_table\n" +
- "- foo_table2\n"));
+ config.add(new YamlDataNode("/metadata/foo_db/rules/broadcast/tables", "tables:\n"
+ + "- foo_table\n"
+ + "- foo_table2\n"));
BroadcastRuleConfiguration result = swapper.swapToObject(config);
assertThat(result.getTables().size(), is(2));
Iterator<String> iterator = result.getTables().iterator();