pparthenhs commented on a change in pull request #15775:
URL: https://github.com/apache/shardingsphere/pull/15775#discussion_r818525036



##########
File path: 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/check/consistency/CRC32MatchMySQLSingleTableDataCalculatorTest.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.data.pipeline.mysql.check.consistency;
+
+import 
org.apache.shardingsphere.data.pipeline.api.check.consistency.DataCalculateParameter;
+import 
org.apache.shardingsphere.data.pipeline.api.datasource.PipelineDataSourceWrapper;
+import 
org.apache.shardingsphere.data.pipeline.core.exception.PipelineDataConsistencyCheckFailedException;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.stream.StreamSupport;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+
+@RunWith(MockitoJUnitRunner.class)
+public final class CRC32MatchMySQLSingleTableDataCalculatorTest {
+
+    @Mock
+    private DataCalculateParameter dataCalculateParameter;
+
+    private PipelineDataSourceWrapper pipelineJobPrepareFailedException;
+
+    @Before
+    public void setUp() throws SQLException {
+        pipelineJobPrepareFailedException = 
mock(PipelineDataSourceWrapper.class, RETURNS_DEEP_STUBS);
+        Collection<String> columnNames = new 
ArrayList<String>(Arrays.asList("fieldOne", "fieldTwo", "fieldThree"));
+        
when(dataCalculateParameter.getLogicTableName()).thenReturn("tableName");
+        when(dataCalculateParameter.getColumnNames()).thenReturn(columnNames);
+        
when(dataCalculateParameter.getDataSource()).thenReturn(pipelineJobPrepareFailedException);
+    }
+
+    @Test
+    public void assertCRC32MatchMySQLSingleTableDataCalculatorSuccess() {
+        String algorithmType = new 
CRC32MatchMySQLSingleTableDataCalculator().getAlgorithmType();
+        Assert.assertEquals("CRC32_MATCH", algorithmType);

Review comment:
       Thanks for your comment and your time.
   
   Sure I will change it. 
   
   Based on your comment, I make a quick research regarding `assertThat` vs 
`assertEquals`. As read the benefit is on readability and not for performance 
site. 
[course](https://objectpartners.com/2013/09/18/the-benefits-of-using-assertthat-over-other-assert-methods-in-unit-tests/)
   
   What is your point of view? 
   
   Best regards,
   Panagiotis Parthenis




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to