alpreu commented on code in PR #19552:
URL: https://github.com/apache/flink/pull/19552#discussion_r863505977
##########
flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvRowDataSerDeSchemaTest.java:
##########
@@ -358,12 +354,8 @@ public void testSerializationWithTypesMismatch() {
new CsvRowDataSerializationSchema.Builder(rowType);
RowData rowData = rowData("Test", 1, "Test");
String errorMessage = "Fail to serialize at field: f2.";
- try {
- serialize(serSchemaBuilder, rowData);
- fail("expecting exception message:" + errorMessage);
- } catch (Throwable t) {
- assertThat(t, FlinkMatchers.containsMessage(errorMessage));
- }
+ assertThatThrownBy(() -> serialize(serSchemaBuilder, rowData))
+ .satisfies(anyCauseMatches(errorMessage));
Review Comment:
I had another look at it and to me it looks like the original also checks
the whole chain. The matcher is calling `findThrowable` which iterates through
the chain and checks if the predicate (containsMessage) is correct
--
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]