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

            val service = CoreAuthenticationTestUtils.getService("https://delegated2.example.org");
            servicesManager.save(RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of()));
            context.setParameter(CasProtocolConstants.PARAMETER_SERVICE, service.getId());

            assertEquals(CasWebflowConstants.TRANSITION_ID_GENERATE, delegatedAuthenticationAction.execute(context).getId());

            val generated = delegatedAuthenticationCreateClientsAction.execute(context);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, generated.getId());

            assertEquals(HttpStatus.FOUND.value(), context.getHttpServletResponse().getStatus());
            assertEquals(DelegatedClientIdentityProviderConfigurationFactory.ENDPOINT_URL_REDIRECT + "?client_name=CasClient",
                context.getHttpServletResponse().getHeader("Location"));
        }
This class tests the {@link DelegatedClientAuthenticationAction} class.

@author Jerome Leleu
@since 3.5.2
support/cas-server-support-pac4j-webflow/src/test/java/org/apereo/cas/web/flow/actions/DelegatedClientAuthenticationActionTests.java