@Test public void testDoPost() throws ServletException, IOException { final int uiContextID = 1; final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter(ClientToServerModel.UI_CONTEXT_ID.toStringValue())).thenReturn(String.valueOf(uiContextID)); Mockito.when(request.getParameter(ClientToServerModel.STREAM_REQUEST_ID.toStringValue())).thenReturn("2"); final Application application = new Application("0", null, null); final UIContext uiContext = Mockito.mock(UIContext.class); Mockito.when(uiContext.getID()).thenReturn(uiContextID); application.registerUIContext(uiContext); SessionManager.get().registerApplication(application); final HttpServletResponse response = Mockito.mock(HttpServletResponse.class); streamServiceServlet.doPost(request, response); Mockito.verify(response, Mockito.times(1)).sendError(ArgumentMatchers.eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), ArgumentMatchers.any()); SessionManager.get().unregisterApplication(application); }
@Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { try { process(req, resp); } catch (final IOException e) { log.error("Cannot stream request", e); } }
StreamServiceServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { try { process(req, resp); } catch (final IOException e) { log.error("Cannot stream request", e); } } }
StreamServiceServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { try { process(req, resp); } catch (final IOException e) { log.error("Cannot stream request", e); } }  }
StreamServiceServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { try { process(req, resp); } catch (final IOException e) { log.error("Cannot stream request", e); } }   }
StreamServiceServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { try { process(req, resp); } catch (final IOException e) { log.error("Cannot stream request", e); } }    }