lianetm commented on code in PR #16043:
URL: https://github.com/apache/kafka/pull/16043#discussion_r1631466015
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegateTest.java:
##########
@@ -169,14 +180,38 @@ public void testHasAnyPendingRequests() throws Exception {
}
}
+ @Test
+ public void testPropagateMetadataError() {
+ AuthenticationException authException = new
AuthenticationException("Test Auth Exception");
+ doThrow(authException).when(metadata).maybeThrowAnyException();
+
+ LinkedList<BackgroundEvent> backgroundEventQueue = new LinkedList<>();
+ this.backgroundEventHandler = new
BackgroundEventHandler(backgroundEventQueue);
+ NetworkClientDelegate networkClientDelegate =
newNetworkClientDelegate();
+
+ assertEquals(0, backgroundEventQueue.size());
+ networkClientDelegate.poll(0, time.milliseconds());
+ assertEquals(1, backgroundEventQueue.size());
+
+ BackgroundEvent event = backgroundEventQueue.poll();
+ assertNotNull(event);
+ assertEquals(BackgroundEvent.Type.ERROR, event.type());
+ assertEquals(authException, ((ErrorEvent) event).error());
Review Comment:
I see you created the authException above but we're not using it here to
simplify, do you plan to?
--
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]