Search in sources :

Example 1 with JaasAuthenticationFailedEvent

use of org.springframework.security.authentication.jaas.event.JaasAuthenticationFailedEvent in project spring-security by spring-projects.

the class DefaultJaasAuthenticationProviderTests method verifyFailedLogin.

private void verifyFailedLogin() {
    verify(publisher).publishEvent(argThat(new BaseMatcher<JaasAuthenticationFailedEvent>() {

        public void describeTo(Description desc) {
            desc.appendText("isA(org.springframework.security.authentication.jaas.event.JaasAuthenticationFailedEvent)");
            desc.appendText(" && event.getException() != null");
        }

        public boolean matches(Object arg) {
            JaasAuthenticationFailedEvent e = (JaasAuthenticationFailedEvent) arg;
            return e.getException() != null;
        }
    }));
    verifyNoMoreInteractions(publisher);
}
Also used : Description(org.hamcrest.Description) BaseMatcher(org.hamcrest.BaseMatcher) JaasAuthenticationFailedEvent(org.springframework.security.authentication.jaas.event.JaasAuthenticationFailedEvent)

Aggregations

BaseMatcher (org.hamcrest.BaseMatcher)1 Description (org.hamcrest.Description)1 JaasAuthenticationFailedEvent (org.springframework.security.authentication.jaas.event.JaasAuthenticationFailedEvent)1