dajac commented on code in PR #13231:
URL: https://github.com/apache/kafka/pull/13231#discussion_r1122927383
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -1303,11 +1305,13 @@ public void
testCommitWithTopicAuthorizationFailureInAddPartitionsInFlight() thr
Map<TopicPartition, Errors> errors = new HashMap<>();
errors.put(tp0, Errors.TOPIC_AUTHORIZATION_FAILED);
errors.put(tp1, Errors.OPERATION_NOT_ATTEMPTED);
+ AddPartitionsToTxnResult result =
AddPartitionsToTxnResponse.resultForTransaction(AddPartitionsToTxnResponse.V3_AND_BELOW_TXN_ID,
errors);
+ AddPartitionsToTxnResponseData data = new
AddPartitionsToTxnResponseData().setResultsByTopicV3AndBelow(result.topicResults()).setThrottleTimeMs(0);
client.respond(body -> {
AddPartitionsToTxnRequest request = (AddPartitionsToTxnRequest)
body;
- assertEquals(new HashSet<>(request.partitions()), new
HashSet<>(errors.keySet()));
+ assertEquals(new
HashSet<>(AddPartitionsToTxnRequest.getPartitions(request.data().v3AndBelowTopics())),
new HashSet<>(errors.keySet()));
Review Comment:
I tend to agree with this. Are those helpers only used in tests? If so, it
may be better to put them in `AddPartitionsToTxnRequestTest`. What do you think?
--
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]