@Test
    void verifyProxyTicket() throws Throwable {
        try (val webServer = new MockWebServer(HttpStatus.OK)) {
            webServer.start();
            val service = RegisteredServiceTestUtils.getService("http://localhost:%s".formatted(webServer.getPort()));
            val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of());
            registeredService.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy().setUseServiceId(true));
            servicesManager.save(registeredService);

            val ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), service);

            val tId = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
            val sId = getCentralAuthenticationService().grantServiceTicket(tId.getId(), service, ctx);

            val request = new MockHttpServletRequest();
            request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, service.getId());
            request.addParameter(CasProtocolConstants.PARAMETER_TICKET, sId.getId());
            request.addParameter(CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL, service.getId());

            val response = new MockHttpServletResponse();
            var mv = proxyValidateController.handleRequestInternal(request, response);
            assertTrue(Objects.requireNonNull(mv.getView()).toString().contains(SUCCESS));
            val pgt = mv.getModelMap().get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET).toString();

            request.removeAllParameters();
            request.addParameter(CasProtocolConstants.PARAMETER_TARGET_SERVICE, service.getId());
            request.addParameter(CasProtocolConstants.PARAMETER_PROXY_GRANTING_TICKET, pgt);
            mv = proxyController.handleRequestInternal(request, response);
            val pt = mv.getModelMap().get(CasProtocolConstants.PARAMETER_TICKET).toString();

            request.removeAllParameters();
            request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, service.getId());
            request.addParameter(CasProtocolConstants.PARAMETER_TICKET, pt);
            mv = proxyValidateController.handleRequestInternal(request, response);
            assertTrue(Objects.requireNonNull(mv.getView()).toString().contains(SUCCESS));
            mv.getView().render(mv.getModel(), request, response);
            assertTrue(response.getContentAsString().contains("<cas:proxy>%s</cas:proxy>".formatted(service.getId())));
        }

    }
This is {@link ProxyValidateControllerTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-validation/src/test/java/org/apereo/cas/web/ProxyValidateControllerTests.java