@Test
    public void testValidateCredentials() {
        val formClient = getFormClient();
        val context = MockWebContext.create();
        val action = (FoundAction) TestsHelper.expectException(
            () -> formClient.validateCredentials(new CallContext(context, new MockSessionStore()),
                new UsernamePasswordCredentials(USERNAME, PASSWORD)));
        assertEquals(302, action.getCode());
        assertEquals(LOGIN_URL + "?" + formClient.getUsernameParameter() + "=" + USERNAME + "&"
                + FormClient.ERROR_PARAMETER + "=" + CredentialsException.class.getSimpleName(), action.getLocation());
    }
This class tests the {@link FormClient} class.

@author Jerome Leleu
@since 1.4.0
pac4j-http/src/test/java/org/pac4j/http/client/indirect/FormClientTests.java