chia7712 commented on a change in pull request #9401: URL: https://github.com/apache/kafka/pull/9401#discussion_r525690436
########## File path: clients/src/test/java/org/apache/kafka/common/requests/ProduceResponseTest.java ########## @@ -100,16 +113,92 @@ public void produceResponseRecordErrorsTest() { ProduceResponse response = new ProduceResponse(responseData); Struct struct = response.toStruct(ver); assertEquals("Should use schema version " + ver, ApiKeys.PRODUCE.responseSchema(ver), struct.schema()); - ProduceResponse.PartitionResponse deserialized = new ProduceResponse(struct).responses().get(tp); + ProduceResponse.PartitionResponse deserialized = new ProduceResponse(new ProduceResponseData(struct, ver)).responses().get(tp); if (ver >= 8) { assertEquals(1, deserialized.recordErrors.size()); assertEquals(3, deserialized.recordErrors.get(0).batchIndex); assertEquals("Record error", deserialized.recordErrors.get(0).message); assertEquals("Produce failed", deserialized.errorMessage); } else { assertEquals(0, deserialized.recordErrors.size()); - assertEquals(null, deserialized.errorMessage); + assertNull(deserialized.errorMessage); } } } + + /** + * the schema in this test is from previous code and the automatic protocol should be compatible to previous schema. + */ + @Test + public void testCompatibility() { Review comment: That makes sense to me. Will remove redundant test. ---------------------------------------------------------------- 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