LoadInformationServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  LoadInformationServlet(QueueSizeProvider queueSizeProvider, DeletedFileProvider deletedFileProvider, MessageFileCounter messageCounter);   }
@Test public final void testDoPostSetsResponseTypeAndWritesResponseUsingLoadInformation() throws ServletException, IOException { given(deletedFileProvider.getDeletedFilesCount()).willReturn(0); given(messageCounter.getCountOfMessages()).willReturn(0); given(queueSizeProvider.getResponseQueueSize()).willReturn(0L); given(queueSizeProvider.getLoggerQueueSize()).willReturn(0L); given(response.getWriter()).willReturn(printWriter); underTest.doPost(request, response); verify(response).setContentType("application/json"); verify(printWriter).write(Mockito.anyString()); }