@Test public void writeResult_ok() throws IOException { servlet.writeResult(response, "test"); verify(response, times(1)).setStatus(HttpServletResponse.SC_OK); verify(writer, times(1)).write("test"); }
protected void writeResult(SlingHttpServletResponse response, String json, int status) throws IOException { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.setStatus(status); response.getWriter().write(json); }
BaseServlet extends SlingAllMethodsServlet { protected void writeResult(SlingHttpServletResponse response, String json, int status) throws IOException { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.setStatus(status); response.getWriter().write(json); } }
BaseServlet extends SlingAllMethodsServlet { protected void writeResult(SlingHttpServletResponse response, String json, int status) throws IOException { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.setStatus(status); response.getWriter().write(json); }  }
BaseServlet extends SlingAllMethodsServlet { protected void writeResult(SlingHttpServletResponse response, String json, int status) throws IOException { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.setStatus(status); response.getWriter().write(json); }   }
BaseServlet extends SlingAllMethodsServlet { protected void writeResult(SlingHttpServletResponse response, String json, int status) throws IOException { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.setStatus(status); response.getWriter().write(json); }    }