@Test
    void verifyDelegatedAccessAnd() {
        val chain = new ChainingRegisteredServiceAccessStrategy();
        chain.setOperator(LogicalOperatorTypes.AND);
        var s1 = new DefaultRegisteredServiceAccessStrategy(CollectionUtils.wrap("key1", Set.of("value1")));
        s1.setDelegatedAuthenticationPolicy(new DefaultRegisteredServiceDelegatedAuthenticationPolicy()
            .setExclusive(true).setPermitUndefined(true).setAllowedProviders(List.of("P1")));
        chain.addStrategy(s1);

        var s2 = new DefaultRegisteredServiceAccessStrategy(CollectionUtils.wrap("key2", Set.of("value2")));
        s2.setDelegatedAuthenticationPolicy(new DefaultRegisteredServiceDelegatedAuthenticationPolicy()
            .setExclusive(false).setPermitUndefined(false).setAllowedProviders(List.of("P2")));
        chain.addStrategy(s2);

        val delegation = chain.getDelegatedAuthenticationPolicy();
        assertNotNull(delegation);
        assertFalse(delegation.isExclusive());
        assertFalse(delegation.isPermitUndefined());
        assertTrue(delegation.getAllowedProviders().contains("P1"));
        assertTrue(delegation.getAllowedProviders().contains("P2"));
        assertFalse(delegation.isProviderRequired());
        assertFalse(delegation.isProviderAllowed("P2", new CasRegisteredService()));
    }
This is {@link ChainingRegisteredServiceAccessStrategyTests}.

@author Misagh Moayyed
@since 6.5.0
core/cas-server-core-services-api/src/test/java/org/apereo/cas/services/ChainingRegisteredServiceAccessStrategyTests.java