@Test
    void verifyOperationAutoRedirect() throws Throwable {
        val context = MockRequestContext.create(applicationContext);

        val accessStrategy = new DefaultRegisteredServiceAccessStrategy();
        val policy = new DefaultRegisteredServiceDelegatedAuthenticationPolicy();
        policy.setAllowedProviders(List.of("CasClient"));
        policy.setPermitUndefined(false);

        accessStrategy.setDelegatedAuthenticationPolicy(policy);
        val registeredService = RegisteredServiceTestUtils.getRegisteredService("https://delegated2.example.org");
        registeredService.setAccessStrategy(accessStrategy);
        servicesManager.save(registeredService);
        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService("https://delegated2.example.org"));
        assertNotNull(producer.produce(context));
        assertNotNull(DelegationWebflowUtils.getDelegatedAuthenticationProviderConfigurations(context));
        assertNotNull(DelegationWebflowUtils.getDelegatedAuthenticationProviderPrimary(context));
    }
This is {@link DelegatedClientIdentityProviderConfigurationProducerTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-pac4j-webflow/src/test/java/org/apereo/cas/web/flow/DelegatedClientIdentityProviderConfigurationProducerTests.java