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 7c52e254100 Fix test case (#31065)
7c52e254100 is described below
commit 7c52e2541003f62e07cd3e1d172752f1747a710d
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Apr 30 00:42:52 2024 +0800
Fix test case (#31065)
* Refactor RepositoryTupleSwapper's impl
* Fix test case
* Fix test case
* Fix test case
---
.../swapper/MaskRuleConfigurationRepositoryTupleSwapperTest.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git
a/features/mask/core/src/test/java/org/apache/shardingsphere/mask/yaml/swapper/MaskRuleConfigurationRepositoryTupleSwapperTest.java
b/features/mask/core/src/test/java/org/apache/shardingsphere/mask/yaml/swapper/MaskRuleConfigurationRepositoryTupleSwapperTest.java
index 8e04a0d05e4..9a206bdd176 100644
---
a/features/mask/core/src/test/java/org/apache/shardingsphere/mask/yaml/swapper/MaskRuleConfigurationRepositoryTupleSwapperTest.java
+++
b/features/mask/core/src/test/java/org/apache/shardingsphere/mask/yaml/swapper/MaskRuleConfigurationRepositoryTupleSwapperTest.java
@@ -41,18 +41,17 @@ class MaskRuleConfigurationRepositoryTupleSwapperTest {
@Test
void assertSwapEmptyConfigurationToDataNodes() {
- MaskRuleConfiguration config = new
MaskRuleConfiguration(Collections.emptyList(), Collections.emptyMap());
- assertTrue(new
MaskRuleConfigurationRepositoryTupleSwapper().swapToRepositoryTuples(config).isEmpty());
+ MaskRuleConfiguration ruleConfig = new
MaskRuleConfiguration(Collections.emptyList(), Collections.emptyMap());
+ assertTrue(new
MaskRuleConfigurationRepositoryTupleSwapper().swapToRepositoryTuples(ruleConfig).isEmpty());
}
@Test
void assertSwapFullConfigurationToDataNodes() {
- MaskRuleConfiguration config = createMaximumMaskRule();
- Collection<RepositoryTuple> actual = new
MaskRuleConfigurationRepositoryTupleSwapper().swapToRepositoryTuples(config);
+ Collection<RepositoryTuple> actual = new
MaskRuleConfigurationRepositoryTupleSwapper().swapToRepositoryTuples(createMaximumMaskRule());
assertThat(actual.size(), is(2));
Iterator<RepositoryTuple> iterator = actual.iterator();
- assertThat(iterator.next().getKey(), is("mask_algorithms/FIXTURE"));
assertThat(iterator.next().getKey(), is("tables/foo"));
+ assertThat(iterator.next().getKey(), is("mask_algorithms/FIXTURE"));
}
private MaskRuleConfiguration createMaximumMaskRule() {