}
@Test
public void testThatErrorHandlingWorksJson() {
Response response = makeRequest(
Request.GET().addHeader("ACCEPT", "application/json")
.url(testServerUrl().path("throw_exception")));
Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(400));
Message message = response.payloadJsonAs(Message.class);
Assert.assertThat(message.text, CoreMatchers.equalTo("Oops. That's a bad request and all we know."));
}