@ExceptionHandler({HttpMessageNotReadableException.class})
  @ResponseStatus(HttpStatus.BAD_REQUEST)
  protected ResponseEntity<RestError> handleHttpMessageNotReadableException(HttpMessageNotReadableException httpMessageNotReadableException) {
    String exceptionMessage = getExceptionMessage(httpMessageNotReadableException);
    return new ResponseEntity<>(new RestError(exceptionMessage), HttpStatus.BAD_REQUEST);
  }
@Test
  public void handleHttpMessageNotReadableException_whenCauseIsNotInvalidFormatException_shouldUseMessage() {

    HttpMessageNotReadableException exception = new HttpMessageNotReadableException("Message not readable", new Exception());

    ResponseEntity<RestError> responseEntity = underTest.handleHttpMessageNotReadableException(exception);

    assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST);
    assertThat(responseEntity.getBody().message()).isEqualTo("Message not readable; nested exception is java.lang.Exception");
  }