chia7712 commented on a change in pull request #10332:
URL: https://github.com/apache/kafka/pull/10332#discussion_r595747248
##########
File path:
clients/src/test/java/org/apache/kafka/common/requests/ProduceResponseTest.java
##########
@@ -40,42 +41,39 @@
public void produceResponseV5Test() {
Map<TopicPartition, ProduceResponse.PartitionResponse> responseData =
new HashMap<>();
TopicPartition tp0 = new TopicPartition("test", 0);
- responseData.put(tp0, new
ProduceResponse.PartitionResponse(Errors.NONE,
- 10000, RecordBatch.NO_TIMESTAMP, 100));
+ responseData.put(tp0, new
ProduceResponse.PartitionResponse(Errors.NONE, 10000, RecordBatch.NO_TIMESTAMP,
100));
ProduceResponse v5Response = new ProduceResponse(responseData, 10);
short version = 5;
ByteBuffer buffer =
RequestTestUtils.serializeResponseWithHeader(v5Response, version, 0);
ResponseHeader.parse(buffer,
ApiKeys.PRODUCE.responseHeaderVersion(version)); // throw away.
- ProduceResponse v5FromBytes = (ProduceResponse)
AbstractResponse.parseResponse(ApiKeys.PRODUCE,
- buffer, version);
-
- assertEquals(1, v5FromBytes.responses().size());
- assertTrue(v5FromBytes.responses().containsKey(tp0));
- ProduceResponse.PartitionResponse partitionResponse =
v5FromBytes.responses().get(tp0);
- assertEquals(100, partitionResponse.logStartOffset);
- assertEquals(10000, partitionResponse.baseOffset);
+ ProduceResponse v5FromBytes = (ProduceResponse)
AbstractResponse.parseResponse(ApiKeys.PRODUCE, buffer, version);
+
+ assertEquals(1, v5FromBytes.data().responses().size());
Review comment:
Is this equal to previous check? The previous `assertEquals` checks the
number of `topic partition`. By contrast, it check the number of `topic` now.
----------------------------------------------------------------
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]