fsk119 commented on a change in pull request #16068:
URL: https://github.com/apache/flink/pull/16068#discussion_r645248832
##########
File path:
flink-formats/flink-json/src/test/java/org/apache/flink/formats/json/JsonRowDataSerDeSchemaTest.java
##########
@@ -562,7 +562,10 @@ public void testSerializationMapNullKey() throws Exception
{
serializationSchema1.serialize(rowData);
Assert.fail("expecting exception message: " + errorMessage1);
} catch (Throwable t) {
- assertEquals(errorMessage1, t.getCause().getMessage());
+ // t is for fail to serialize RowData
+ // t.getCause() is for fail to serialize field in the RowData
+ // t.getCause().getCause() is for why fail to serialize this field
+ assertEquals(errorMessage1, t.getCause().getCause().getMessage());
Review comment:
Use `assertThat(t, FlinkMatchers.containsMessage(errorMessage1));`
instead. It will help to find the root cause.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]