@Test
    void verifyCasAuthenticationPolicyFailureEvent() {
        assertRepositoryIsEmpty();

        val transaction = CoreAuthenticationTestUtils.getAuthenticationTransactionFactory()
            .newTransaction(CoreAuthenticationTestUtils.getService(),
                CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());

        val event = new CasAuthenticationPolicyFailureEvent(this,
            CollectionUtils.wrap("error", new FailedLoginException()), transaction,
            CoreAuthenticationTestUtils.getAuthentication(), null);
        publishEventAndWaitToProcess(event);
        assertFalse(casEventRepository.load().findAny().isEmpty());
    }
This is {@link CasAuthenticationEventListenerTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-events/src/test/java/org/apereo/cas/support/events/CasAuthenticationEventListenerTests.java