StubModeOnServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { logger.info(urlAccessLogMessageAssembler.assembleMessage(req, "Set Operation Mode: STUB.")); proxyModeToggle.switchProxyModeOff(); routingService.setOperationMode(OperationMode.STUB); } @Autowired  StubModeOnServlet(UrlAccessLogMessageAssembler urlAccessLogMessageAssembler, ProxyModeToggle proxyModeToggle, RoutingService routingService);   }
@Test public void testDoGetShouldSwitchOffProxyMode() throws ServletException, IOException { underTest.doGet(request, response); verify(proxyModeToggle).switchProxyModeOff(); }
@Test public void testDoGetShouldSetOpModeAndToggleInRoutingService() throws ServletException, IOException { OperationMode operationMode = OperationMode.STUB; underTest.doGet(request, response); verify(routingService).setOperationMode(operationMode); }
@Test public void testDoGetShouldAssembleMessage() throws ServletException, IOException { underTest.doGet(request, response); verify(urlAccessLogMessageAssembler).assembleMessage(Mockito.any(HttpServletRequest.class), Mockito.anyString()); }