dajac commented on code in PR #19642:
URL: https://github.com/apache/kafka/pull/19642#discussion_r2077894203
##########
clients/src/test/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandlerTest.java:
##########
@@ -233,117 +279,226 @@ public void testFailedHandleResponse() {
@Test
public void testFailedHandleResponseWithMultipleGroups() {
- Map<String, Errors> errorMap = new HashMap<>();
- errorMap.put(groupZero, Errors.GROUP_AUTHORIZATION_FAILED);
- errorMap.put(groupOne, Errors.GROUP_ID_NOT_FOUND);
- errorMap.put(groupTwo, Errors.INVALID_GROUP_ID);
- Map<String, Class<? extends Throwable>> groupToExceptionMap = new
HashMap<>();
- groupToExceptionMap.put(groupZero, GroupAuthorizationException.class);
- groupToExceptionMap.put(groupOne, GroupIdNotFoundException.class);
- groupToExceptionMap.put(groupTwo, InvalidGroupIdException.class);
- assertFailedForMultipleGroups(groupToExceptionMap,
- handleWithErrorWithMultipleGroups(errorMap, batchedRequestMap));
+ var errorMap = Map.of(
+ group0, Errors.GROUP_AUTHORIZATION_FAILED,
+ group1, Errors.GROUP_ID_NOT_FOUND,
+ group2, Errors.INVALID_GROUP_ID
+ );
+ var groupToExceptionMap = Map.of(
+ group0, (Class<? extends Throwable>)
GroupAuthorizationException.class,
+ group1, (Class<? extends Throwable>)
GroupIdNotFoundException.class,
+ group2, (Class<? extends Throwable>) InvalidGroupIdException.class
+ );
+ assertFailedForMultipleGroups(
+ groupToExceptionMap,
+ handleWithErrorWithMultipleGroups(errorMap, multiGroupSpecs)
+ );
}
private OffsetFetchResponse buildResponse(Errors error) {
return new OffsetFetchResponse(
- throttleMs,
- Collections.singletonMap(groupZero, error),
- Collections.singletonMap(groupZero, new HashMap<>()));
- }
-
- private OffsetFetchResponse buildResponseWithMultipleGroups(
- Map<String, Errors> errorMap,
- Map<String, Map<TopicPartition, PartitionData>> responseData
- ) {
- return new OffsetFetchResponse(throttleMs, errorMap, responseData);
Review Comment:
@lianetm I don't see any `throttleMs` in this file after the refactor. Could
you please elaborate?
--
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]