@Test
public void testInvalidJson()
{

    String json = "{\"age\": \"foo\"}";
    JsonResponse<User> response = handler.handle(null, mockResponse().contentType(JSON_UTF_8).body(json).build());
    assertFalse(response.hasValue());
    assertEquals(response.getException().getMessage(), format("Unable to create %s from JSON response:\n[%s]", User.class, json));
    assertInstanceOf(response.getException().getCause(), IllegalArgumentException.class);
    assertEquals(response.getException().getCause().getMessage(), "Invalid JSON bytes for [simple type, class com.proofpoint.http.client.TestFullJsonResponseHandler$User]");
    assertEquals(response.getJson(), json);
    assertEquals(response.getResponseBytes(), response.getJsonBytes());
    assertEquals(response.getResponseBody(), response.getJson());
}