azexcy commented on code in PR #22048:
URL: https://github.com/apache/shardingsphere/pull/22048#discussion_r1019762290


##########
test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/check/consistency/DataMatchDataConsistencyCalculateAlgorithmTest.java:
##########
@@ -80,37 +82,43 @@ private void createTableAndInitData(final 
PipelineDataSourceWrapper dataSource,
         }
     }
     
+    @SuppressWarnings("unchecked")
     @Test
-    public void assertCalculateFromBegin() throws NoSuchFieldException, 
IllegalAccessException {
+    public void assertCalculateFromBegin() throws NoSuchFieldException, 
IllegalAccessException, InvocationTargetException, NoSuchMethodException {
         DataMatchDataConsistencyCalculateAlgorithm calculateAlgorithm = new 
DataMatchDataConsistencyCalculateAlgorithm();
         ReflectionUtil.setFieldValue(calculateAlgorithm, "chunkSize", 5);
         DataConsistencyCalculateParameter sourceParameter = 
generateParameter(source, "t_order_copy", null);
-        Optional<DataConsistencyCalculatedResult> sourceCalculateResult = 
calculateAlgorithm.calculateChunk(sourceParameter);
+        Optional<DataConsistencyCalculatedResult> sourceCalculateResult = 
(Optional<DataConsistencyCalculatedResult>) 
ReflectionUtil.invokeMethod(calculateAlgorithm, "calculateChunk",
+                new Class[]{DataConsistencyCalculateParameter.class}, new 
Object[]{sourceParameter});

Review Comment:
   <img width="1090" alt="image" 
src="https://user-images.githubusercontent.com/101622833/201244666-d14d3589-ad53-4746-90a4-633e53d5b15a.png";>
   Because `calculateChunk ` is protected, pipeline test can't be called 
directly method



-- 
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