@Test
    void verifyRedirectUrl() {
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();

        request.addParameter(CasProtocolConstants.PARAMETER_METHOD, "some-method");
        request.addParameter(casProperties.getLocale().getParamName(), "some-locale");
        request.addParameter(casProperties.getTheme().getParamName(), "some-theme");
        val context = new JEEContext(request, response);

        val service = RegisteredServiceTestUtils.getService("example");
        service.setOriginalUrl("http://service.original.url.com");
        val client = new CasClient(new CasConfiguration());
        val factory = DelegatedClientIdentityProviderConfigurationFactory.builder()
            .casProperties(casProperties)
            .client(client)
            .service(service)
            .webContext(context)
            .build();

        val actual = factory.resolve();

        assertTrue(actual.isPresent());
        assertEquals(client.getName(), actual.get().getName());
        assertEquals("cas", actual.get().getType());
        val redirectUrl = actual.get().getRedirectUrl();
        assertNotNull(redirectUrl);

        assertTrue(redirectUrl.startsWith("clientredirect?"));
        assertTrue(redirectUrl.contains("client_name=" + client.getName()));
        assertTrue(redirectUrl.contains("method=some-method"));
        assertTrue(redirectUrl.contains("locale=some-locale"));
        assertTrue(redirectUrl.contains("theme=some-theme"));
        assertTrue(redirectUrl.contains(EncodingUtils.urlEncode(service.getOriginalUrl())));
    }
This is {@link DelegatedClientIdentityProviderConfigurationFactoryTests}.

@author Adrian Gonzalez
@since 6.2.0
support/cas-server-support-pac4j-core/src/test/java/org/apereo/cas/web/DelegatedClientIdentityProviderConfigurationFactoryTests.java