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 2021/11/01 14:25:22 UTC

[shardingsphere] branch master updated: Use assertThat to instead of assertEquals. (#13397)

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 4f4c6c7  Use assertThat to instead of assertEquals. (#13397)
4f4c6c7 is described below

commit 4f4c6c7ab2abbb899010931fb12fd2877dac4264
Author: yx9o <ya...@163.com>
AuthorDate: Mon Nov 1 22:24:44 2021 +0800

    Use assertThat to instead of assertEquals. (#13397)
---
 .../rdl/create/impl/CreateShardingAlgorithmStatementAssert.java      | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rdl/create/impl/CreateShardingAlgorithmStatementAssert.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rdl/create/impl/CreateShardingAlgorithmStatementAssert.java
index d0b603b..61842f1 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rdl/create/impl/CreateShardingAlgorithmStatementAssert.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rdl/create/impl/CreateShardingAlgorithmStatementAssert.java
@@ -31,9 +31,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
-import static org.junit.Assert.assertEquals;
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
 
 /**
  * Create sharding algorithm statement assert.
@@ -66,7 +67,7 @@ public final class CreateShardingAlgorithmStatementAssert {
             for (ExpectedShardingAlgorithm each : expected) {
                 ShardingAlgorithmSegment actualAlgorithm = actualMap.get(each.getShardingAlgorithmName());
                 assertNotNull(assertContext.getText("Actual sharding algorithm should exist."), actualAlgorithm);
-                assertEquals(each.getShardingAlgorithmName(), actualAlgorithm.getShardingAlgorithmName());
+                assertThat(actualAlgorithm.getShardingAlgorithmName(), is(each.getShardingAlgorithmName()));
                 AlgorithmAssert.assertIs(assertContext, actualAlgorithm.getAlgorithmSegment(), each.getAlgorithmSegment());
             }
         }