@Test public void testOnApplicationEventWhenModeIsProxyShouldSwitchProxyModeOn() { OperationMode operationMode = OperationMode.PROXY; PropertyDto properties = builder.operationMode(operationMode).build(); given(configurationAccess.getProperties()).willReturn(properties); given(requestProcessor.containsProcessor(routerProcessor)).willReturn(true); given(requestProcessor.isProcessorEnabled(routerProcessor)).willReturn(true); underTest.onApplicationEvent(event); verify(requestProcessor).disableProcessor(routerProcessor); }
@Override public void onApplicationEvent(final ContextRefreshedEvent event) { PropertyDto properties = configurationAccess.getProperties(); OperationMode operationMode = properties.getOperationMode(); if (operationMode == OperationMode.PROXY) { switchProxyModeOn(); } }
ProxyModeToggle implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(final ContextRefreshedEvent event) { PropertyDto properties = configurationAccess.getProperties(); OperationMode operationMode = properties.getOperationMode(); if (operationMode == OperationMode.PROXY) { switchProxyModeOn(); } } }
ProxyModeToggle implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(final ContextRefreshedEvent event) { PropertyDto properties = configurationAccess.getProperties(); OperationMode operationMode = properties.getOperationMode(); if (operationMode == OperationMode.PROXY) { switchProxyModeOn(); } }  }
ProxyModeToggle implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(final ContextRefreshedEvent event) { PropertyDto properties = configurationAccess.getProperties(); OperationMode operationMode = properties.getOperationMode(); if (operationMode == OperationMode.PROXY) { switchProxyModeOn(); } }  @Override void onApplicationEvent(final ContextRefreshedEvent event); void switchProxyModeOn(); void switchProxyModeOff(); boolean isProxyModeOn(); }
ProxyModeToggle implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(final ContextRefreshedEvent event) { PropertyDto properties = configurationAccess.getProperties(); OperationMode operationMode = properties.getOperationMode(); if (operationMode == OperationMode.PROXY) { switchProxyModeOn(); } }  @Override void onApplicationEvent(final ContextRefreshedEvent event); void switchProxyModeOn(); void switchProxyModeOff(); boolean isProxyModeOn();  }