ProxyModeToggle implements ApplicationListener<ContextRefreshedEvent> { public void switchProxyModeOff() { if (requestProcessor.containsProcessor(routerProcessor)) { requestProcessor.enableProcessor(routerProcessor); } }  @Override void onApplicationEvent(final ContextRefreshedEvent event); void switchProxyModeOn(); void switchProxyModeOff(); boolean isProxyModeOn();  }
@Test public void testSwitchProxyModeOffWhenRouterProcessorIsNotInListShouldEnableProcessor() { given(requestProcessor.containsProcessor(routerProcessor)).willReturn(true); given(requestProcessor.isProcessorEnabled(routerProcessor)).willReturn(false); underTest.switchProxyModeOff(); verify(requestProcessor).enableProcessor(routerProcessor); }