### Question:
SimpleServlet extends SlingSafeMethodsServlet { @Override protected void doGet(final SlingHttpServletRequest req, final SlingHttpServletResponse resp) throws ServletException, IOException { final Resource resource = req.getResource(); resp.setContentType("text/plain"); resp.getWriter().write("Title = " + resource.getValueMap().get(JcrConstants.JCR_TITLE)); }    }### Answer:
@Test public void doGet() throws ServletException, IOException { context.build().resource("/content/test", "jcr:title", "resource title").commit(); context.currentResource("/content/test"); MockSlingHttpServletRequest request = context.request(); MockSlingHttpServletResponse response = context.response(); fixture.doGet(request, response); assertEquals("Title = resource title", response.getOutputAsString()); }