This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 8325fd9 Use assertThat to instead of assertEquals. (#12602)
8325fd9 is described below
commit 8325fd96de026a8111157e3cdc4a4837edbbafd1
Author: yx9o <[email protected]>
AuthorDate: Tue Sep 21 10:51:54 2021 +0800
Use assertThat to instead of assertEquals. (#12602)
---
.../distsql/converter/ShadowRuleStatementConverterTest.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/converter/ShadowRuleStatementConverterTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/converter/ShadowRuleStatementConverterTest.java
index bc7260d..ce616f5 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/converter/ShadowRuleStatementConverterTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/converter/ShadowRuleStatementConverterTest.java
@@ -29,18 +29,19 @@ import org.junit.Test;
import java.util.Collections;
import java.util.Properties;
-import static org.junit.Assert.assertEquals;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
public final class ShadowRuleStatementConverterTest {
@Test
public void assertConvert() {
ShadowRuleConfiguration config =
ShadowRuleStatementConverter.convert(Collections.singleton(createTableRuleSegment()));
- assertEquals("source",
config.getDataSources().get("ruleName").getSourceDataSourceName());
- assertEquals("shadow",
config.getDataSources().get("ruleName").getShadowDataSourceName());
- assertEquals(1, config.getTables().size());
- assertEquals(1, config.getShadowAlgorithms().size());
- assertEquals("bar",
config.getShadowAlgorithms().get("algorithmsName").getProps().get("foo"));
+
assertThat(config.getDataSources().get("ruleName").getSourceDataSourceName(),
is("source"));
+
assertThat(config.getDataSources().get("ruleName").getShadowDataSourceName(),
is("shadow"));
+ assertThat(config.getTables().size(), is(1));
+ assertThat(config.getShadowAlgorithms().size(), is(1));
+
assertThat(config.getShadowAlgorithms().get("algorithmsName").getProps().get("foo"),
is("bar"));
}
private ShadowRuleSegment createTableRuleSegment() {