Skip to content

Commit

Permalink
Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder (apa…
Browse files Browse the repository at this point in the history
…che#26618)

* Refactor YamlDataNode

* Move NewYamlBroadcastRuleConfigurationSwapperTest to test folder
  • Loading branch information
terrymanu authored Jun 27, 2023
1 parent cbc5b2d commit dc3156e
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,11 +52,7 @@ void assertSwapFullConfigToDataNodes() {
}

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
Expand All @@ -68,9 +65,9 @@ void assertSwapToObjectEmpty() {
@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();
Expand Down

0 comments on commit dc3156e

Please sign in to comment.