### Question:
DefaultResponseErrorHandler implements ResponseErrorHandler { @Override public void handleError(final ClientHttpResponse response) throws IOException { throw new HttpClientErrorException(response.getStatusCode(), response.getStatusText()); }  @Override boolean hasError(final ClientHttpResponse response); @Override void handleError(final ClientHttpResponse response);  }### Answer:
@Test public void test_handleError_success() throws IOException { final HttpStatus statusCode = HttpStatus.BAD_REQUEST; final String statusText = "test text"; when(clientHttpResponse.getStatusCode()).thenReturn(statusCode); when(clientHttpResponse.getStatusText()).thenReturn(statusText); try { errorHandler.handleError(clientHttpResponse); fail(); } catch (final HttpClientErrorException ex) { assertEquals(statusCode, ex.getStatusCode()); assertEquals(statusText, ex.getStatusText()); } }