@Test
        void verifyStopWebflowOnCredentialFailure() throws Throwable {
            val context = MockRequestContext.create(applicationContext).withUserAgent().setClientInfo();
            context.setParameter(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER, "BadCredentialsClient");

            context.setParameter(ThemeChangeInterceptor.DEFAULT_PARAM_NAME, "theme");
            context.setParameter(LocaleChangeInterceptor.DEFAULT_PARAM_NAME, Locale.getDefault().getCountry());
            context.setParameter(CasProtocolConstants.PARAMETER_METHOD, HttpMethod.POST.name());
            val service = RegisteredServiceTestUtils.getService(UUID.randomUUID().toString());
            servicesManager.save(RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of()));
            context.setParameter(CasProtocolConstants.PARAMETER_SERVICE, service.getId());

            val webContext = new JEEContext(context.getHttpServletRequest(), context.getHttpServletResponse());
            val client = identityProviders.findClient("BadCredentialsClient", webContext).orElseThrow();
            val ticket = delegatedClientAuthenticationWebflowManager.store(context, webContext, client);
            context.setParameter(DelegatedClientAuthenticationWebflowManager.PARAMETER_CLIENT_ID, ticket.getId());

            assertEquals(CasWebflowConstants.TRANSITION_ID_STOP, delegatedAuthenticationAction.execute(context).getId());
        }
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