You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/07/07 04:39:08 UTC

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

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

jianglongtao 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 eed2faeb288 Use assertThat to instead of assertEquals. (#18918)
eed2faeb288 is described below

commit eed2faeb2883baafbfe8291cb946860098be2315
Author: yx9o <ya...@163.com>
AuthorDate: Thu Jul 7 12:39:03 2022 +0800

    Use assertThat to instead of assertEquals. (#18918)
---
 .../mysql/ingest/MySQLInventoryDumperTest.java     | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLInventoryDumperTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLInventoryDumperTest.java
index 0021588eea6..66acec19f4b 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLInventoryDumperTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLInventoryDumperTest.java
@@ -17,15 +17,6 @@
 
 package org.apache.shardingsphere.data.pipeline.mysql.ingest;
 
-import java.sql.Connection;
-import java.sql.Date;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
-import javax.sql.DataSource;
 import lombok.SneakyThrows;
 import org.apache.shardingsphere.data.pipeline.api.config.ingest.DumperConfiguration;
 import org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
@@ -39,7 +30,18 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
 
-import static org.junit.Assert.assertEquals;
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -100,9 +102,9 @@ public final class MySQLInventoryDumperTest {
         String resultTimeStamp = (String) mysqlJdbcDumper.readValue(resultSet, 1);
         Object resultObject = mysqlJdbcDumper.readValue(resultSet, 2);
         Date resultDate = (Date) mysqlJdbcDumper.readValue(resultSet, 3);
-        assertEquals(resultTimeStamp, mockDateString);
-        assertEquals(resultObject, mockObject);
-        assertEquals(resultDate, mockDate);
+        assertThat(resultTimeStamp, is(mockDateString));
+        assertThat(resultObject, is(mockObject));
+        assertThat(resultDate, is(mockDate));
         verify(resultSet).getString(1);
         verify(resultSet).getObject(2);
         verify(resultSet).getObject(3);