lianetm commented on code in PR #17109:
URL: https://github.com/apache/kafka/pull/17109#discussion_r1747439518
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java:
##########
@@ -1499,6 +1538,37 @@ public ClientResponse mockOffsetCommitResponse(String
topic,
);
}
+ public ClientResponse mockOffsetCommitResponse(String topic,
+
List<OffsetCommitResponseData.OffsetCommitResponsePartition> partitions,
+ short apiKeyVersion) {
+ return mockOffsetCommitResponse(topic, partitions, apiKeyVersion,
time.milliseconds(), time.milliseconds());
+ }
+
+ public ClientResponse mockOffsetCommitResponse(String topic,
+
List<OffsetCommitResponseData.OffsetCommitResponsePartition> partitions,
+ short apiKeyVersion,
+ long createdTimeMs,
+ long receivedTimeMs) {
+ OffsetCommitResponseData responseData = new OffsetCommitResponseData()
+ .setTopics(Collections.singletonList(
+ new
OffsetCommitResponseData.OffsetCommitResponseTopic()
+ .setName(topic)
+ .setPartitions(partitions)));
+ OffsetCommitResponse response = mock(OffsetCommitResponse.class);
+ when(response.data()).thenReturn(responseData);
+ return new ClientResponse(
+ new RequestHeader(ApiKeys.OFFSET_COMMIT, apiKeyVersion, "", 1),
+ null,
+ "-1",
+ createdTimeMs,
+ receivedTimeMs,
+ false,
+ null,
+ null,
+ new OffsetCommitResponse(responseData)
+ );
+ }
+
public ClientResponse mockOffsetCommitResponseDisconnected(String topic,
int partition,
Review Comment:
same for this one, not introduced here but I would expect all this mock
helpers to be private to this 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]