NegotiateAuthenticationStrategy extends AbstractAuthenticationStrategy { @Override public AuthenticationInfo afterAttempt(final Realm realm, final AuthenticationToken token, final AuthenticationInfo singleRealmInfo, final AuthenticationInfo aggregateInfo, final Throwable t) { if (realm instanceof NegotiateAuthenticationRealm && t instanceof AuthenticationInProgressException) { throw (AuthenticationInProgressException) t; } return super.afterAttempt(realm, token, singleRealmInfo, aggregateInfo, t); }  @Override AuthenticationInfo afterAttempt(final Realm realm, final AuthenticationToken token,
            final AuthenticationInfo singleRealmInfo, final AuthenticationInfo aggregateInfo, final Throwable t);  }
@Test void testAfterAttempt() { final Realm otherRealm = new IniRealm(); this.authStrategy.afterAttempt(otherRealm, null, null, null, new RuntimeException()); final AuthenticationInProgressException authInProgressException = new AuthenticationInProgressException(); this.authStrategy.afterAttempt(otherRealm, null, null, null, authInProgressException); final Throwable exception = Assertions.assertThrows(AuthenticationInProgressException.class, () -> { this.authStrategy.afterAttempt(new NegotiateAuthenticationRealm(), null, null, null, authInProgressException); }); Assertions.assertNull(exception.getMessage()); }