OmniaGM commented on code in PR #15506: URL: https://github.com/apache/kafka/pull/15506#discussion_r1521475624
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerSinkTaskTest.java: ########## @@ -553,12 +547,8 @@ public void testErrorInRebalancePartitionLoss() { workerTask.iteration(); verifyPollInitialAssignment(); - try { - workerTask.iteration(); - fail("Poll should have raised the rebalance exception"); - } catch (RuntimeException e) { - assertEquals(exception, e); - } + Throwable thrownException = assertThrows(RuntimeException.class, () -> workerTask.iteration()); Review Comment: The type of the `thrownException` should be `RuntimeException` as it has been casted when we called `assertThrows(RuntimeException.class, <lambda>)` -- 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