@Test
        void verifyByCredentialTypeAndServiceByResolvers() throws Throwable {
            val credential = new UsernamePasswordCredential();
            credential.setUsername(UUID.randomUUID().toString());
            credential.assignPassword(credential.getUsername());
            credential.setSource("Handler1");

            val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
            val authnPolicy = mock(RegisteredServiceAuthenticationPolicy.class);
            when(authnPolicy.getRequiredAuthenticationHandlers()).thenReturn(Set.of("Handler2"));
            when(registeredService.getAuthenticationPolicy()).thenReturn(authnPolicy);

            val service = CoreAuthenticationTestUtils.getWebApplicationService();
            val transaction = CoreAuthenticationTestUtils.getAuthenticationTransactionFactory().newTransaction(service, credential);
            when(servicesManager.findServiceBy(any(Service.class))).thenReturn(registeredService);
            val handlers = authenticationEventExecutionPlan.resolveAuthenticationHandlers(transaction);
            assertEquals(2, handlers.size());
            assertTrue(handlers.stream().anyMatch(h -> "Handler1".equalsIgnoreCase(h.getName())));
            assertTrue(handlers.stream().anyMatch(h -> "Handler3".equalsIgnoreCase(h.getName())));
        }
This is {@link DefaultAuthenticationEventExecutionPlanTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-authentication/src/test/java/org/apereo/cas/authentication/DefaultAuthenticationEventExecutionPlanTests.java