@Test
    void verifyCaptchaValidated() throws Throwable {
        val props = casProperties.getGoogleRecaptcha();
        val port = URI.create(props.getVerifyUrl()).getPort();
        
        val context = MockRequestContext.create(applicationContext);

        val data = "{\"success\": true }";
        context.setParameter(GoogleCaptchaV2Validator.REQUEST_PARAM_RECAPTCHA_RESPONSE, data);

        try (val webServer = new MockWebServer(port,
            new ByteArrayResource(data.getBytes(StandardCharsets.UTF_8), "REST Output"), MediaType.APPLICATION_JSON_VALUE)) {
            webServer.start();
            val result = validateCaptchaAction.execute(context);
            assertNull(result);
        }
    }
This is {@link ValidateCaptchaActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-captcha/src/test/java/org/apereo/cas/web/flow/ValidateCaptchaActionTests.java