### Question:
DataServiceServlet extends ApiServlet { @Override protected void sendError(HttpServletResponse servletResponse, ResponseItem responseItem) throws IOException { String errorMessage = responseItem.getErrorMessage(); int errorCode = responseItem.getErrorCode(); if (errorCode < 0) { switch (errorCode) { case -32700: case -32602: case -32600: errorCode = HttpServletResponse.SC_BAD_REQUEST; break; case -32601: errorCode = HttpServletResponse.SC_NOT_IMPLEMENTED; break; case -32603: default: errorCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; break; } } servletResponse.sendError(errorCode, errorMessage); }  BeanConverter getConverterForRequest(@Nullable String contentType, String format); static final Set<String> ALLOWED_CONTENT_TYPES; }### Answer:
@Test public void testFailedRequest() throws Exception { String route = "/test"; setupRequest(route, "DELETE", null); res.sendError(HttpServletResponse.SC_BAD_REQUEST, TestHandler.FAILURE_MESSAGE); res.setCharacterEncoding("UTF-8"); res.setContentType(ContentTypes.OUTPUT_JSON_CONTENT_TYPE); mockControl.replay(); servlet.service(req, res); mockControl.verify(); mockControl.reset(); }