chia7712 commented on a change in pull request #9874: URL: https://github.com/apache/kafka/pull/9874#discussion_r556619811
########## File path: clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java ########## @@ -1550,13 +1549,8 @@ public void testCannotReauthenticateWithDifferentPrincipal() throws Exception { * original token with a new one. */ delay(1000L); - try { - checkClientConnection(node); - fail("Re-authentication with a different principal should have failed but did not"); - } catch (AssertionError e) { - // ignore, expected - server.verifyReauthenticationMetrics(0, 1); - } + assertThrows(AssertionFailedError.class, () -> checkClientConnection(node)); Review comment: It would be better that we can make accurate assert for ```checkClientConnection``` (it has multi assert checks) ---------------------------------------------------------------- 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: us...@infra.apache.org