private void publishEventAndWaitToProcess(final AbstractCasEvent event) {
        var currentCount = casEventRepository.load().count();
        applicationContext.publishEvent(event);
        waitForSpringEventToProcess(currentCount + 1);
    }
Count the current number of events in the {@link CasEventRepository }
Publish the async event to the application context,
Wait for the async event to process.

@param event The event to publish
core/cas-server-core-events/src/test/java/org/apereo/cas/support/events/CasAuthenticationEventListenerTests.java