@Test
    void verifyActionClientIpRejected() throws Throwable {
        val context = MockRequestContext.create();
        context.setRemoteAddr("185.86.151.11").setLocalAddr("185.88.151.11").withUserAgent(USER_AGENT).setClientInfo();

        val props = new AdaptiveAuthenticationProperties();
        props.getPolicy().setRejectIpAddresses("185\\.86.+");
        val service = mock(GeoLocationService.class);
        var policy = new DefaultAdaptiveAuthenticationPolicy(service, IPAddressIntelligenceService.banned(), props);
        val location = new GeoLocationRequest(51.5, -0.118);
        assertFalse(policy.isAuthenticationRequestAllowed(context, USER_AGENT, location));

        policy = new DefaultAdaptiveAuthenticationPolicy(service, (__, clientIpAddress) -> IPAddressIntelligenceResponse.builder()
            .status(IPAddressIntelligenceResponse.IPAddressIntelligenceStatus.RANKED)
            .score(12.15)
            .build(), props);
        assertFalse(policy.isAuthenticationRequestAllowed(new MockRequestContext(), USER_AGENT, location));
    }
This is {@link DefaultAdaptiveAuthenticationPolicyTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-authentication-api/src/test/java/org/apereo/cas/authentication/adaptive/DefaultAdaptiveAuthenticationPolicyTests.java