@Test
    public void testGetCredentialsMissingPassword() {
        val formClient = getFormClient();
        val context = MockWebContext.create().addRequestParameter(formClient.getPasswordParameter(), PASSWORD);
        val action = (FoundAction) TestsHelper.expectException(
            () -> formClient.getCredentials(new CallContext(context, new MockSessionStore())));
        assertEquals(302, action.getCode());
        assertEquals(LOGIN_URL + "?" + formClient.getUsernameParameter() + "=&" + FormClient.ERROR_PARAMETER + "="
               + FormClient.MISSING_FIELD_ERROR, 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