SequenceHandlingCleanUpServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { sequenceMaintainer.runOnDemand(); logger.info(urlAccessLogMessageAssembler.assembleMessage(req, "Sequence maintenance task invoked manually")); } @Autowired  SequenceHandlingCleanUpServlet(UrlAccessLogMessageAssembler urlAccessLogMessageAssembler, SequenceMaintainer sequenceMaintainer);   }
@Test public void testDoGetShouldRunMaintainerTaskOnDemand() throws ServletException, IOException { underTest.doGet(req, resp); verify(sequenceMaintainer).runOnDemand(); }
@Test public void testDoGetShouldLogMessage() throws ServletException, IOException { given(urlAccessLogMessageAssembler.assembleMessage(req, MESSAGE)).willReturn("something"); underTest.doGet(req, resp); verify(urlAccessLogMessageAssembler).assembleMessage(req, MESSAGE); verify(logger).info("something"); }