You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/03 06:31:53 UTC
[GitHub] [flink] alpreu commented on a diff in pull request #19552: [FLINK-27185][connectors][formats] Convert formats and connectors modules to assertj
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org