@Test
public void shouldCreateJsonServiceExceptionResponseWithMessageFromInvocationTargetException()
        throws Exception {

    // given
    Exception e = new InvocationTargetException(
            new JsonServiceException(HttpResponseStatus.PRECONDITION_FAILED, "A message"));
    // when
    CommonResponse httpResponse = HTTP_SERVER_HANDLER.newHttpResponseFromException(
            mock(CommonRequest.class), mock(Authentication.class), e);
    // then
    String content = (String) httpResponse.getContent();
    assertThat(content).isEqualTo("{\"message\":\"A message\"}");
    assertThat(httpResponse.getStatus()).isEqualTo(HttpResponseStatus.PRECONDITION_FAILED);
}