chia7712 commented on code in PR #18825:
URL: https://github.com/apache/kafka/pull/18825#discussion_r1954133711
##########
clients/src/test/java/org/apache/kafka/test/TestUtils.java:
##########
@@ -583,12 +583,12 @@ public static Set<TopicPartition>
generateRandomTopicPartitions(int numTopic, in
* Assert that a future raises an expected exception cause type. Return
the exception cause
* if the assertion succeeds; otherwise raise AssertionError.
*
- * @param future The future to await
- * @param exceptionCauseClass Class of the expected exception cause
* @param <T> Exception cause type parameter
+ * @param exceptionCauseClass Class of the expected exception cause
+ * @param future The future to await
* @return The caught exception cause
*/
- public static <T extends Throwable> T assertFutureThrows(Future<?> future,
Class<T> exceptionCauseClass) {
+ public static <T extends Throwable> T assertFutureThrows(Class<T>
exceptionCauseClass, Future<?> future) {
ExecutionException exception = assertThrows(ExecutionException.class,
future::get);
Throwable cause = exception.getCause();
assertEquals(exceptionCauseClass, cause.getClass(),
Review Comment:
Yes, in the previous PR we preferred to do strict check for the type of
exception. Maybe we can keep the origin behavior but this PR can add comments
to avoid potential confusion in the future.
--
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]