SignForAppServlet extends HttpServlet { @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); try { resp.getWriter().println(simulateIdentityAssertion()); } catch (Exception e) { throw new RuntimeException(e); } } SignForAppServlet(); @Override void doGet(HttpServletRequest req, HttpServletResponse resp);  }
@Test public void doGet_defaultEnvironment_successfullyVerifiesSignature() throws Exception { servletUnderTest.doGet(mockRequest, mockResponse); assertWithMessage("SignForAppServlet response") .that(responseWriter.toString()) .contains("isValid=true for message: abcdefg"); }