### Question:
WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly); @Override void setStatus(int status); @Override void addHeader(String name, String value); @Override void setHeader(String name, String value); @Override OutputStream getOutputStream(); @Override void sendError(int code); @Override void sendError(int code, String message); @Override void end();  }### Answer:
@Test public void testSendError() throws Exception { int status = HttpStatus.UNAUTHORIZED.value(); String reason = HttpStatus.UNAUTHORIZED.getReasonPhrase(); response.sendError(status, reason); verify(mockResponse).sendError(eq(status), eq(reason)); assertEquals(status, mockResponse.getStatus()); assertEquals(reason, mockResponse.getErrorMessage()); }