@Test
    void verifyCasTicketGrantingTicketDestroyedHasClientInfoWithMultipleThreads() throws Throwable {
        assertRepositoryIsEmpty();
        var currentCount = casEventRepository.load().count();
        try (val threadPool = Executors.newFixedThreadPool(THREAD_POOL_SIZE)) {

            val futureList = new ArrayList<Future<Integer>>();
            var expectedNumOfIp1 = 0;
            for (var x = 0; x < NUM_OF_REQUESTS; x++) {
                if (shouldUseIp1(x)) {
                    expectedNumOfIp1++;
                }
                futureList.add(threadPool.submit(new HttpServletRequestSimulation(x, shouldUseIp1(x), applicationContext)));
            }
            var maxThread = -1;
            for (val future : futureList) {
                var currentThread = future.get();
                if (currentThread > maxThread) {
                    maxThread = currentThread;
                }
            }

            waitForSpringEventToProcess(currentCount + maxThread + 1);
            assertNotNull(casEventRepository.load());
            val list = casEventRepository.load().toList();
            assertFalse(list.isEmpty());
            val eventSize = list.size();
            val numOfIp1s = (int) list.stream().filter(e -> HttpServletRequestSimulation.IP1.equals(e.getClientIpAddress())).count();
            assertEquals(maxThread + 1, eventSize);
            assertEquals(expectedNumOfIp1, numOfIp1s);
        }
    }
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