dajac commented on code in PR #12388:
URL: https://github.com/apache/kafka/pull/12388#discussion_r916672037


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinatorTest.java:
##########
@@ -1164,6 +1168,34 @@ public void testHandleNormalLeaveGroupResponse() {
         assertTrue(leaveGroupFuture.succeeded());
     }
 
+    @Test
+    public void testHandleNormalLeaveGroupResponseAndTruncatedLeaveReason() {
+        MemberResponse memberResponse = new MemberResponse()
+                                            .setMemberId(memberId)
+                                            .setErrorCode(Errors.NONE.code());
+        LeaveGroupResponse leaveGroupResponse =
+            leaveGroupResponse(Collections.singletonList(memberResponse));
+        String leaveReason = "Very 
looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
 leaveReason that is 271 characters long to make sure that length limit logic 
handles the scenario nicely";
+        setupCoordinator(RETRY_BACKOFF_MS, Integer.MAX_VALUE, 
Optional.empty());
+
+        mockClient.prepareResponse(groupCoordinatorResponse(node, 
Errors.NONE));

Review Comment:
   Instead of duplicating all this code, could we reuse `setupLeaveGroup`? We 
could perhaps adds an overload - e.g. `setupLeaveGroup(leaveGroupResponse, 
reason)`. 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]

Reply via email to