@Test
    void notifySuccessAfterDoAuthenticate() {
        AuthenticationListener mockListener = createMock(AuthenticationListener.class);
        abstractAuthenticator.getAuthenticationListeners().add(mockListener);
        AuthenticationToken token = newToken();
        mockListener.onSuccess(token, info);

        replay(mockListener);
        abstractAuthenticator.authenticate(token);
        verify(mockListener);
    }
Ensures a non-null <tt>Subject</tt> instance is returned from the authenticate() method after a valid
authentication attempt (i.e. the subclass's doAuthenticate implementation returns a valid, non-null
AuthenticationInfo object).
core/src/test/java/org/apache/shiro/authc/AbstractAuthenticatorTest.java