ProxyModeOnServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { logger.info(urlAccessLogMessageAssembler.assembleMessage(req, "Set Operation Mode: PROXY.")); proxyModeToggle.switchProxyModeOn(); routingService.setOperationMode(OperationMode.PROXY); } @Autowired  ProxyModeOnServlet(UrlAccessLogMessageAssembler urlAccessLogMessageAssembler, ProxyModeToggle proxyModeToggle, RoutingService routingService);   }
@Test public void testDoGetShouldSwitchOnProxyMode() throws ServletException, IOException { underTest.doGet(request, response); verify(proxyModeToggle).switchProxyModeOn(); }
@Test public void testDoGetShouldSetOpModeAndToggleInRoutingService() throws ServletException, IOException { OperationMode operationMode = OperationMode.PROXY; 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()); }