@Test public void testDoGetShouldWriteUrlAndTextToResponse() throws ServletException, IOException { underTest.doGet(request, response); verify(writer).write("{\"readmeUrl\":\"" + readme.getUrl() + "\", \"readmeText\":\"" + readme.getText() + "\"}"); }
@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(); }
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(); } }
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); }
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);  }
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);   }