@Test
public void defaultCredentials() {

    String user = "ceo";
    String password = "12345";
    HttpClientConfig httpClientConfig = new HttpClientConfig.Builder("localhost")
            .defaultCredentials(user, password)
            .build();
    CredentialsProvider credentialsProvider = httpClientConfig.getCredentialsProvider();
    Credentials credentials = credentialsProvider.getCredentials(new AuthScope("localhost", 80));
    assertEquals(user, credentials.getUserPrincipal().getName());
    assertEquals(password, credentials.getPassword());
}