@Test public void whenUrlIsValidThenDeleteIsCalled() throws ServletException, IOException { servlet.doDelete(request, response); verify(callback).onMethodCalled(Delete); }
@Override public final void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Delete) { RestUrl url = parse(req); if (url.isValid()) { ((Delete) this).delete(req, resp, url); } else { onInvalidUrl(url); super.doDelete(req, resp); } } }
RestServlet extends HttpServlet { @Override public final void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Delete) { RestUrl url = parse(req); if (url.isValid()) { ((Delete) this).delete(req, resp, url); } else { onInvalidUrl(url); super.doDelete(req, resp); } } } }
RestServlet extends HttpServlet { @Override public final void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Delete) { RestUrl url = parse(req); if (url.isValid()) { ((Delete) this).delete(req, resp, url); } else { onInvalidUrl(url); super.doDelete(req, resp); } } } protected  RestServlet(String pattern, VarType... types); }
RestServlet extends HttpServlet { @Override public final void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Delete) { RestUrl url = parse(req); if (url.isValid()) { ((Delete) this).delete(req, resp, url); } else { onInvalidUrl(url); super.doDelete(req, resp); } } } protected  RestServlet(String pattern, VarType... types); @Override final void doGet(HttpServletRequest req, HttpServletResponse resp); @Override final void doPost(HttpServletRequest req, HttpServletResponse resp); @Override final void doPut(HttpServletRequest req, HttpServletResponse resp); @Override final void doDelete(HttpServletRequest req, HttpServletResponse resp); }
RestServlet extends HttpServlet { @Override public final void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Delete) { RestUrl url = parse(req); if (url.isValid()) { ((Delete) this).delete(req, resp, url); } else { onInvalidUrl(url); super.doDelete(req, resp); } } } protected  RestServlet(String pattern, VarType... types); @Override final void doGet(HttpServletRequest req, HttpServletResponse resp); @Override final void doPost(HttpServletRequest req, HttpServletResponse resp); @Override final void doPut(HttpServletRequest req, HttpServletResponse resp); @Override final void doDelete(HttpServletRequest req, HttpServletResponse resp);  }