WilmaReadmeServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { resp.setContentType("application/json"); PrintWriter out = resp.getWriter(); PropertyDTO properties = webAppConfigurationAccess.getProperties(); Readme readme = properties.getReadme(); out.write("{\"readmeUrl\":\"" + readme.getUrl() + "\", \"readmeText\":\"" + readme.getText() + "\"}"); out.flush(); out.close(); } @Autowired  WilmaReadmeServlet(WebAppConfigurationAccess webAppConfigurationAccess);   }
@Test public void testDoGetShouldWriteUrlAndTextToResponse() throws ServletException, IOException { underTest.doGet(request, response); verify(writer).write("{\"readmeUrl\":\"" + readme.getUrl() + "\", \"readmeText\":\"" + readme.getText() + "\"}"); }
@Test public void testDoGetShouldSetResponseContentTypeToJson() throws ServletException, IOException { underTest.doGet(request, response); verify(response).setContentType("application/json"); }