Example usage for org.apache.http.impl.nio.client HttpAsyncClients createMinimal

List of usage examples for org.apache.http.impl.nio.client HttpAsyncClients createMinimal

Introduction

In this page you can find the example usage for org.apache.http.impl.nio.client HttpAsyncClients createMinimal.

Prototype

public static CloseableHttpAsyncClient createMinimal() 

Source Link

Document

Creates CloseableHttpAsyncClient instance that supports esential HTTP protocol aspects only.

Usage

From source file:com.clxcommunications.xms.ApiConnectionTest.java

@Test
public void canBuildWithAllCustoms() throws Exception {
    String token = TestUtils.freshToken();
    String spid = TestUtils.freshServicePlanId();
    URI url = URI.create("https://localhost:3000/basepath");
    CloseableHttpAsyncClient client = HttpAsyncClients.createMinimal();

    ApiConnection conn = ApiConnection.builder().token(token).servicePlanId(spid).endpoint(url)
            .callbackWrapper(CallbackWrapper.identity).prettyPrintJson(false).httpClient(client).build();

    assertThat(conn.token(), is(token));
    assertThat(conn.servicePlanId(), is(spid));
    assertThat(conn.endpoint(), is(url));
    assertThat(conn.callbackWrapper(), is(sameInstance(CallbackWrapper.identity)));
    assertThat(conn.prettyPrintJson(), is(false));
    assertThat(conn.httpClient(), is(sameInstance((HttpAsyncClient) client)));
}