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 aec8903 Revise #16310 (#16346)
aec8903 is described below
commit aec8903602b1c07f9eea4c5cd80a222b3eaeb74e
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Mar 24 22:48:57 2022 +0800
Revise #16310 (#16346)
---
.../builder/global/GlobalRulesBuilderTest.java | 24 +++++-----------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
index d046283..33424de 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
@@ -17,35 +17,21 @@
package org.apache.shardingsphere.infra.rule.builder.global;
-import com.google.common.collect.Maps;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import java.util.Collection;
import java.util.Collections;
-import java.util.Map;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
-@RunWith(MockitoJUnitRunner.class)
public final class GlobalRulesBuilderTest {
- @Mock
- private RuleConfiguration ruleConfiguration;
-
- @Mock
- private ShardingSphereMetaData shardingSphereMetaData;
-
@Test
- public void assertBuildRules() {
- Map<String, ShardingSphereMetaData> metaDataMap = Maps.newHashMap();
- metaDataMap.put("logic_db", shardingSphereMetaData);
- Collection<ShardingSphereRule> shardingSphereRules =
GlobalRulesBuilder.buildRules(Collections.singletonList(ruleConfiguration),
metaDataMap);
- assertTrue(shardingSphereRules.isEmpty());
+ public void assertBuildRulesWithoutGlobalRules() {
+
assertTrue(GlobalRulesBuilder.buildRules(Collections.singletonList(mock(RuleConfiguration.class)),
Collections.singletonMap("logic_db",
mock(ShardingSphereMetaData.class))).isEmpty());
}
+
+ // TODO add more test cases for BuildRulesWithGlobalRules
}