### Question:
InfluxException extends RuntimeException { @Override public String getMessage() { return message; } InfluxException(@Nullable final String message);  InfluxException(@Nullable final Throwable cause);  InfluxException(@Nullable final Response<?> cause); @Override String getMessage(); int reference(); int status(); @Nonnull JSONObject errorBody();  }### Answer:
@Test void errorBodyInfluxDB() { Assertions .assertThatThrownBy(() -> { Response<Object> response = errorResponse("not found", 404, 15, "{\"code\":\"not found\",\"message\":\"user not found\"}", "X-Platform-Error-Code"); throw new InfluxException(new HttpException(response)); }) .matches((Predicate<Throwable>) throwable -> throwable.getMessage().equals("user not found")); }
@Test void errorBodyInfluxDBWithoutMsg() { Assertions .assertThatThrownBy(() -> { Response<Object> response = errorResponse("not found", 404, 15, "{\"code\":\"not found\"}", "X-Platform-Error-Code"); throw new InfluxException(new HttpException(response)); }) .matches((Predicate<Throwable>) throwable -> throwable.getMessage().equals("not found")); }
@Test void errorBodyInfluxDBNotJson() { Assertions .assertThatThrownBy(() -> { Response<Object> response = errorResponse("not found", 404, 15, "not-json", "X-Platform-Error-Code"); throw new InfluxException(new HttpException(response)); }) .matches((Predicate<Throwable>) throwable -> throwable.getMessage().equals("not found")); }