@Test
public void shouldCreateNonTimeoutSqlExceptionResponse() throws Exception {

    // given
    Exception e = new SQLException("Another message", "", H2_STATEMENT_WAS_CANCELED + 1);
    // when
    CommonResponse httpResponse = HTTP_SERVER_HANDLER.newHttpResponseFromException(
            mock(CommonRequest.class), mock(Authentication.class), e);
    // then
    String content = (String) httpResponse.getContent();
    ObjectNode node = (ObjectNode) new ObjectMapper().readTree(content);
    assertThat(node.get("message").asText())
            .isEqualTo("java.sql.SQLException: Another message");
    assertThat(node.get("stackTrace")).isNotNull();
    assertThat(httpResponse.getStatus()).isEqualTo(HttpResponseStatus.INTERNAL_SERVER_ERROR);
}