@Test
    public void testValidateBadIP() {
        val credentials = new TokenCredentials(BAD_IP);
        TestsHelper.expectException(() -> authenticator.validate(new CallContext(null, new MockSessionStore()), credentials),
            CredentialsException.class, "Unauthorized IP address: " + BAD_IP);
    }
This class tests the {@link IpRegexpAuthenticator}.

@author Jerome Leleu
@since 1.8.0
pac4j-http/src/test/java/org/pac4j/http/credentials/authenticator/IpRegexpAuthenticatorTests.java