Commit cf3ae735 by Dave Syer

Fix test (exclude commons refresh processing if not available)

parent 797544e6
...@@ -158,11 +158,18 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order ...@@ -158,11 +158,18 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
EurekaDiscoveryClientConfiguration.this.start(); EurekaDiscoveryClientConfiguration.this.start();
} }
@Configuration
@ConditionalOnClass(EnvironmentChangeEvent.class)
protected static class EurekaClientConfigurationRefresher {
@Autowired
private EurekaDiscoveryClientConfiguration clientConfig;
@EventListener(EnvironmentChangeEvent.class) @EventListener(EnvironmentChangeEvent.class)
public void onApplicationEvent(EnvironmentChangeEvent event) { public void onApplicationEvent(EnvironmentChangeEvent event) {
// register in case meta data changed // register in case meta data changed
stop(); this.clientConfig.stop();
start(); this.clientConfig.start();
}
} }
@EventListener(ContextClosedEvent.class) @EventListener(ContextClosedEvent.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment