From dc3156ebda67808ee9da476ae072ca90ab810391 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 27 Jun 2023 16:30:04 +0800 Subject: [PATCH] Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder (#26618) * Refactor YamlDataNode * Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder --- ...ewYamlBroadcastRuleConfigurationSwapperTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) rename features/broadcast/core/src/{main/test => test/java}/org/apache/shardingsphere/broadcast/yaml/swapper/NewYamlBroadcastRuleConfigurationSwapperTest.java (89%) 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 a8e7f09670637..5008e8fbb2094 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.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 @@ void assertSwapFullConfigToDataNodes() { } private BroadcastRuleConfiguration createMaximumBroadcastRule() { - Collection 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 @@ void assertSwapToObjectEmpty() { @Test void assertSwapToObject() { Collection 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 iterator = result.getTables().iterator();