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 2022/05/25 07:23:01 UTC

[shardingsphere] branch master updated: Refactor ShardingSphereRuleMetaDataTest (#17936)

This is an automated email from the ASF dual-hosted git repository.

zhaojinchao 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 e36f3ab1473 Refactor ShardingSphereRuleMetaDataTest (#17936)
e36f3ab1473 is described below

commit e36f3ab147307b774ce7c685183bf516532ff866
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed May 25 15:22:55 2022 +0800

    Refactor ShardingSphereRuleMetaDataTest (#17936)
---
 ...figuration.java => ShardingSphereRuleConfigurationFixture.java} | 3 +--
 .../infra/metadata/rule/ShardingSphereRuleMetaDataTest.java        | 7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfiguration.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfigurationFixture.java
similarity index 90%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfiguration.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfigurationFixture.java
index 32d40efbcc5..33ff8b485bc 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfiguration.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleConfigurationFixture.java
@@ -19,6 +19,5 @@ package org.apache.shardingsphere.infra.metadata.rule;
 
 import org.apache.shardingsphere.infra.config.scope.SchemaRuleConfiguration;
 
-public class ShardingSphereRuleConfiguration implements SchemaRuleConfiguration {
-
+public final class ShardingSphereRuleConfigurationFixture implements SchemaRuleConfiguration {
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
index 9d8fca709c4..8d573a576d8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
@@ -28,8 +28,7 @@ import static org.junit.Assert.assertTrue;
 public final class ShardingSphereRuleMetaDataTest {
     
     private final ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(
-            Collections.singleton(new ShardingSphereRuleConfiguration()),
-            Collections.singleton(new ShardingSphereRuleFixture()));
+            Collections.singleton(new ShardingSphereRuleConfigurationFixture()), Collections.singleton(new ShardingSphereRuleFixture()));
     
     @Test
     public void assertFindRules() {
@@ -43,11 +42,11 @@ public final class ShardingSphereRuleMetaDataTest {
     
     @Test
     public void assertFindRuleConfigurations() {
-        assertThat(ruleMetaData.findRuleConfigurations(ShardingSphereRuleConfiguration.class).size(), is(1));
+        assertThat(ruleMetaData.findRuleConfigurations(ShardingSphereRuleConfigurationFixture.class).size(), is(1));
     }
 
     @Test
     public void assertFindSingleRuleConfiguration() {
-        assertTrue(ruleMetaData.findSingleRuleConfiguration(ShardingSphereRuleConfiguration.class).isPresent());
+        assertTrue(ruleMetaData.findSingleRuleConfiguration(ShardingSphereRuleConfigurationFixture.class).isPresent());
     }
 }