@BeforeEach
    void initialize() {
        val svc = RegisteredServiceTestUtils.getRegisteredService("serviceid1");
        svc.getAuthenticationPolicy().getRequiredAuthenticationHandlers().addAll(CollectionUtils.wrapHashSet("handler1", "handler2"));
        servicesManager.save(svc);

        val svc2 = RegisteredServiceTestUtils.getRegisteredService("serviceid2");
        svc2.getAuthenticationPolicy().getRequiredAuthenticationHandlers().addAll(new HashSet<>());
        servicesManager.save(svc2);

        val svc3 = RegisteredServiceTestUtils.getRegisteredService("serviceid3");
        svc3.getAuthenticationPolicy().getExcludedAuthenticationHandlers().addAll(Set.of("handler3", "handler1"));
        servicesManager.save(svc3);
        
        val handler1 = new AcceptUsersAuthenticationHandler("handler1");
        val handler2 = new AcceptUsersAuthenticationHandler("handler2");
        val handler3 = new AcceptUsersAuthenticationHandler("handler3");

        this.authenticationHandlers = Stream.of(handler1, handler2, handler3).collect(Collectors.toSet());
    }
This is {@link RegisteredServiceAuthenticationHandlerResolverTests}.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceAuthenticationHandlerResolverTests.java