@Test
    void verifyByIpPattern() throws Throwable {
        val strategy = new DefaultCaptchaActivationStrategy(mock(ServicesManager.class));
        val request = new MockHttpServletRequest();
        val context = MockRequestContext.create();

        val properties = new GoogleRecaptchaProperties()
            .setEnabled(true)
            .setActivateForIpAddressPattern("127.+");
        request.setRemoteAddr("185.86.151.11");
        request.setLocalAddr("195.88.151.11");
        ClientInfoHolder.setClientInfo(ClientInfo.from(request));
        assertFalse(strategy.shouldActivate(context, properties).isPresent());
    }
This is {@link DefaultCaptchaActivationStrategyTests}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-captcha-core/src/test/java/org/apereo/cas/web/DefaultCaptchaActivationStrategyTests.java