@Test
    public void testAuthentication() {
        Client client = new IpClient(new SimpleTestTokenAuthenticator());
        val context = MockWebContext.create();
        context.setRemoteAddress(IP);
        val ctx = new CallContext(context, new MockSessionStore());
        val credentials = (TokenCredentials) client.getCredentials(ctx).get();
        val authnCredentials = client.validateCredentials(ctx, credentials).get();
        UserProfile profile = (CommonProfile) client.getUserProfile(ctx, authnCredentials).get();
        assertEquals(IP, profile.getId());
    }
This class tests the {@link IpClient} class.

@author Jerome Leleu
@since 1.8.0
pac4j-http/src/test/java/org/pac4j/http/client/direct/IpClientTests.java