philipnee commented on code in PR #16043: URL: https://github.com/apache/kafka/pull/16043#discussion_r1630902382
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegateTest.java: ########## @@ -169,14 +183,80 @@ public void testHasAnyPendingRequests() throws Exception { } } + @Test + public void testPropagateMetadataError() { + LinkedList<BackgroundEvent> backgroundEventQueue = new LinkedList<>(); + Metadata metadata = new Metadata(100, 100, 50000, Review Comment: you can do something like this instead of creating a metadata object (which is not needed) ``` Metadata metadata = mock(Metadata.class); NetworkClientDelegate networkClientDelegate = new NetworkClientDelegate(metadata, new BackgroundEventHandler(backgroundEventQueue)); String exMsg = "Test Auth Exception"; AuthenticationException authException = new AuthenticationException(exMsg); doThrow(authException).when(metadata).maybeThrowAnyException(); ``` -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org