afedulov commented on code in PR #19552:
URL: https://github.com/apache/flink/pull/19552#discussion_r863600886


##########
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:
   You are right, I missed that.



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