nastra commented on code in PR #8945:
URL: https://github.com/apache/iceberg/pull/8945#discussion_r1375769193


##########
flink/v1.15/flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkTableSource.java:
##########
@@ -611,44 +608,38 @@ public void testFilterPushDown2Literal() {
   public void testSqlParseError() {
     String sqlParseErrorEqual =
         String.format("SELECT * FROM %s WHERE d = CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorEqual));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorEqual))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);
 
     String sqlParseErrorNotEqual =
         String.format("SELECT * FROM %s WHERE d <> CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorNotEqual));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorNotEqual))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);
 
     String sqlParseErrorGT =
         String.format("SELECT * FROM %s WHERE d > CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorGT));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorGT))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);
 
     String sqlParseErrorLT =
         String.format("SELECT * FROM %s WHERE d < CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorLT));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorLT))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);
 
     String sqlParseErrorGTE =
         String.format("SELECT * FROM %s WHERE d >= CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorGTE));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorGTE))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);
 
     String sqlParseErrorLTE =
         String.format("SELECT * FROM %s WHERE d <= CAST('NaN' AS DOUBLE) ", 
TABLE_NAME);
-    AssertHelpers.assertThrows(
-        "The NaN is not supported by flink now. ",
-        NumberFormatException.class,
-        () -> sql(sqlParseErrorLTE));
+    Assertions.assertThatThrownBy(() -> sql(sqlParseErrorLTE))
+        .as("The NaN is not supported by flink now. ")
+        .isInstanceOf(NumberFormatException.class);

Review Comment:
   all of these need to check the underlying error msg. Also `.as()` isn't 
needed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to