XComp commented on code in PR #19807:
URL: https://github.com/apache/flink/pull/19807#discussion_r889021351


##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunctionTest.java:
##########
@@ -107,7 +107,7 @@ public void testEvalWithCacheMissingKeyPositive() throws 
Exception {
         Cache<RowData, List<RowData>> cache = lookupFunction.getCache();
 
         // empty data should cache
-        assertEquals(cache.getIfPresent(keyRow), 
Collections.<RowData>emptyList());
+        
assertThat(Collections.<RowData>emptyList()).isEqualTo(cache.getIfPresent(keyRow));

Review Comment:
   ```suggestion
           assertThat(cache.getIfPresent(keyRow)).isEmpty();
   ```
   That's nitty but wouldn't that be a better approach?



##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunctionTest.java:
##########
@@ -117,7 +117,7 @@ public void testEvalWithCacheMissingKeyPositive() throws 
Exception {
                         + " (id1, id2, comment1, comment2) VALUES (4, '9', 
'49-c1', '49-c2')");
 
         lookupFunction.eval(4, StringData.fromString("9"));
-        assertEquals(cache.getIfPresent(keyRow), 
Collections.<RowData>emptyList());
+        
assertThat(Collections.<RowData>emptyList()).isEqualTo(cache.getIfPresent(keyRow));

Review Comment:
   ```suggestion
           assertThat(cache.getIfPresent(keyRow)).isEmpty();
   ```
   nit: Same here...



##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunctionTest.java:
##########
@@ -160,7 +160,7 @@ public void testEvalWithCacheMissingKeyNegative() throws 
Exception {
                         StringData.fromString("1"),
                         StringData.fromString("51-c1"),
                         StringData.fromString("51-c2")));
-        assertEquals(cache.getIfPresent(keyRow), expectedOutput);
+        assertThat(expectedOutput).isEqualTo(cache.getIfPresent(keyRow));

Review Comment:
   The `assertThat` expects the actual value, not the expected one. Swapping 
that might lead to confusing output...



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