@Test
public void testInvalidJson()
{

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