chia7712 commented on a change in pull request #9776: URL: https://github.com/apache/kafka/pull/9776#discussion_r548375460
########## File path: clients/src/test/java/org/apache/kafka/common/protocol/types/ProtocolSerializationTest.java ########## @@ -414,7 +416,7 @@ public void testReadWhenOptionalDataMissingAtTheEndIsNotTolerated() { oldFormat.writeTo(buffer); buffer.flip(); SchemaException e = assertThrows(SchemaException.class, () -> newSchema.read(buffer)); - e.getMessage().contains("Error reading field 'field2': java.nio.BufferUnderflowException"); + assertThat(e.getMessage(), containsString("Error reading field 'field2': java.nio.BufferUnderflowException")); Review comment: You are right. Checking ```Error reading field 'field2'``` should be enough for this test case. ---------------------------------------------------------------- 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: us...@infra.apache.org