@Test
public void testInvalidJsonGetValue()
{

    String json = "{\"age\": \"foo\"}";
    JsonResponse<User> response = handler.handle(null, mockResponse().contentType(JSON_UTF_8).body(json).build());
    try {
        response.getValue();
        fail("expected exception");
    }
    catch (IllegalStateException e) {
        assertEquals(e.getMessage(), "Response does not contain a JSON value");
        assertEquals(e.getCause(), response.getException());
        assertEquals(response.getJsonBytes(), json.getBytes(StandardCharsets.UTF_8));
        assertEquals(response.getJson(), json);
        assertEquals(response.getResponseBytes(), response.getJsonBytes());
        assertEquals(response.getResponseBody(), response.getJson());
    }
}