coded9 commented on code in PR #8945:
URL: https://github.com/apache/iceberg/pull/8945#discussion_r1375963552
##########
flink/v1.15/flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkSourceConfig.java:
##########
@@ -31,14 +31,13 @@ public class TestFlinkSourceConfig extends
TestFlinkTableSource {
@Test
public void testFlinkSessionConfig() {
getTableEnv().getConfig().set(FlinkReadOptions.STREAMING_OPTION, true);
- AssertHelpers.assertThrows(
- "Should throw exception because of cannot set snapshot-id option for
streaming reader",
- IllegalArgumentException.class,
- "Cannot set as-of-timestamp option for streaming reader",
- () -> {
- sql("SELECT * FROM %s /*+ OPTIONS('as-of-timestamp'='1')*/", TABLE);
- return null;
- });
+ Assertions.assertThatThrownBy(
+ () -> {
+ sql("SELECT * FROM %s /*+ OPTIONS('as-of-timestamp'='1')*/",
TABLE);
+ })
+ .as("Should throw exception because of cannot set snapshot-id option
for streaming reader")
Review Comment:
Addressed for most of the cases
##########
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:
Addressed
--
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]