@Test public void testDoGetWhenIOExceptionShouldLogError() throws ServletException, IOException { given(bufferedReaderFactory.createBufferedReader(SCHEMA)).willReturn(reader); IOException exception = new IOException(); given(reader.readLine()).willThrow(exception); underTest.doGet(request, response); verify(logger).error(SCHEMA + " could not be read!", exception); }
@Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); resp.setContentType("application/xml"); writeSchemaFile(out); out.flush(); out.close(); }
SchemaProviderServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); resp.setContentType("application/xml"); writeSchemaFile(out); out.flush(); out.close(); } }
SchemaProviderServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); resp.setContentType("application/xml"); writeSchemaFile(out); out.flush(); out.close(); } @Autowired  SchemaProviderServlet(String stubConfigSchemaLocation, BufferedReaderFactory bufferedReaderFactory); }
SchemaProviderServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); resp.setContentType("application/xml"); writeSchemaFile(out); out.flush(); out.close(); } @Autowired  SchemaProviderServlet(String stubConfigSchemaLocation, BufferedReaderFactory bufferedReaderFactory);  }
SchemaProviderServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); resp.setContentType("application/xml"); writeSchemaFile(out); out.flush(); out.close(); } @Autowired  SchemaProviderServlet(String stubConfigSchemaLocation, BufferedReaderFactory bufferedReaderFactory);   }