SivaValidationServiceErrorHandler implements ResponseErrorHandler { @Override public void handleError(ClientHttpResponse clientHttpResponse) throws IOException { LOGGER.error("Response error: {} {}", clientHttpResponse.getStatusCode(), clientHttpResponse.getStatusText()); }  @Override boolean hasError(ClientHttpResponse clientHttpResponse); @Override void handleError(ClientHttpResponse clientHttpResponse);  }
@Test public void givenUserErrorStatusCodeWillLogWarnErrorMessage() throws Exception { errorHandler.handleError(new MockClientHttpResponse(EMPTY_BODY, HttpStatus.BAD_REQUEST)); verify(mockAppender).doAppend(captorLoggingEvent.capture()); final LoggingEvent loggingEvent = captorLoggingEvent.getValue(); Assertions.assertThat(loggingEvent.getLevel()).isEqualTo(Level.ERROR); Assertions.assertThat(loggingEvent.getFormattedMessage()).contains("400 BAD_REQUEST Bad Request"); }