You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/13 14:12:48 UTC
[GitHub] [kafka] ijuma commented on a change in pull request #9874: KAFKA-7340: Migrate clients module to JUnit 5
ijuma commented on a change in pull request #9874:
URL: https://github.com/apache/kafka/pull/9874#discussion_r556547909
##########
File path: clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java
##########
@@ -2128,7 +2116,7 @@ private void createAndCheckClientAuthenticationFailure(SecurityProtocol security
String mechanism, String expectedErrorMessage) throws Exception {
ChannelState finalState = createAndCheckClientConnectionFailure(securityProtocol, node);
Exception exception = finalState.exception();
- assertTrue("Invalid exception class " + exception.getClass(), exception instanceof SaslAuthenticationException);
+ assertTrue(exception instanceof SaslAuthenticationException, "Invalid exception class " + exception.getClass());
Review comment:
Yeah, for existing code improvements (versus code introduced by this change), let's do it via a different PR. For this particular issue, we can probably wait for JUnit 5.8 and use:
> * New assertInstanceOf methods as a replacement for assertTrue(obj instanceof X) which provide better error messages comparable to those of assertThrows.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org