@Test public void testInitOperationModeWhenModeIsNotProxyShouldDoNothing() { OperationMode operationMode = OperationMode.WILMA; PropertyDto properties = builder.operationMode(operationMode).build(); given(configurationAccess.getProperties()).willReturn(properties); given(requestProcessor.containsProcessor(routerProcessor)).willReturn(false); underTest.onApplicationEvent(event); verify(requestProcessor, never()).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();  }