com.google.api.client.http.HttpResponseException.Builder

Here are the examples of the java api class com.google.api.client.http.HttpResponseException.Builder taken from open source projects.

1. HttpResponseExceptionTest#testBuilder()

View license
public void testBuilder() throws Exception {
    HttpHeaders headers = new HttpHeaders();
    Builder builder = new HttpResponseException.Builder(9, "statusMessage", headers).setMessage("message").setContent("content");
    assertEquals("message", builder.getMessage());
    assertEquals("content", builder.getContent());
    assertEquals(9, builder.getStatusCode());
    assertEquals("statusMessage", builder.getStatusMessage());
    assertTrue(headers == builder.getHeaders());
    HttpResponseException e = builder.build();
    assertEquals("message", e.getMessage());
    assertEquals("content", e.getContent());
    assertEquals(9, e.getStatusCode());
    assertEquals("statusMessage", e.getStatusMessage());
    assertTrue(headers == e.getHeaders());
}