xijiu commented on code in PR #18254: URL: https://github.com/apache/kafka/pull/18254#discussion_r1899921489
########## test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/RaftClusterInvocationContext.java: ########## @@ -222,6 +228,24 @@ public void waitForReadyBrokers() throws InterruptedException { } } + @Override + public int getLeaderBrokerId(TopicPartition topicPartition) throws ExecutionException, InterruptedException { + var leaderBrokerId = -1; + try (var admin = admin()) { + DescribeTopicsResult result = admin.describeTopics(List.of(topicPartition.topic())); Review Comment: @chia7712 Yeah, lambda definitely make the code more clearer. And I have moved the method to the interface also, PTAL -- 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