@Test
    void verifyByService() throws Throwable {
        val servicesManager = mock(ServicesManager.class);

        val strategy = new DefaultCaptchaActivationStrategy(servicesManager);
        val context = MockRequestContext.create();

        val service = RegisteredServiceTestUtils.getService(UUID.randomUUID().toString());
        val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId());
        registeredService.getProperties().put(RegisteredServiceProperty.RegisteredServiceProperties.CAPTCHA_ENABLED.getPropertyName(),
            new DefaultRegisteredServiceProperty("true"));
        when(servicesManager.findServiceBy(any(Service.class))).thenReturn(registeredService);

        WebUtils.putServiceIntoFlowScope(context, service);
        val properties = new GoogleRecaptchaProperties().setEnabled(false);
        assertTrue(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