Commit 5dccd03d by Dave Syer

Fix broken test

This test made wrong assumptions about the content of the child context when trying to simulate autoconfiguration. It needed an extra EurekaClientAutoConfiguration.
parent f904b52a
...@@ -32,15 +32,16 @@ import com.netflix.discovery.DiscoveryManager; ...@@ -32,15 +32,16 @@ import com.netflix.discovery.DiscoveryManager;
import com.netflix.discovery.EurekaClientConfig; import com.netflix.discovery.EurekaClientConfig;
/** /**
* Bootstrap configuration for a config client that wants to lookup the config * Bootstrap configuration for a config client that wants to lookup the config server via
* server via discovery. * discovery.
* *
* @author Dave Syer * @author Dave Syer
*/ */
@ConditionalOnBean({ EurekaDiscoveryClientConfiguration.class }) @ConditionalOnBean({ EurekaDiscoveryClientConfiguration.class })
@ConditionalOnProperty(value = "spring.cloud.config.discovery.enabled", matchIfMissing = false) @ConditionalOnProperty(value = "spring.cloud.config.discovery.enabled", matchIfMissing = false)
@Configuration @Configuration
public class DiscoveryClientConfigServiceAutoConfiguration implements ApplicationListener<RefreshScopeRefreshedEvent> { public class DiscoveryClientConfigServiceAutoConfiguration
implements ApplicationListener<RefreshScopeRefreshedEvent> {
@Autowired @Autowired
private EurekaClientConfig clientConfig; private EurekaClientConfig clientConfig;
...@@ -58,7 +59,8 @@ public class DiscoveryClientConfigServiceAutoConfiguration implements Applicatio ...@@ -58,7 +59,8 @@ public class DiscoveryClientConfigServiceAutoConfiguration implements Applicatio
DiscoveryManager.getInstance().getDiscoveryClient().shutdown(); DiscoveryManager.getInstance().getDiscoveryClient().shutdown();
} }
ApplicationInfoManager.getInstance().initComponent(this.instanceConfig); ApplicationInfoManager.getInstance().initComponent(this.instanceConfig);
DiscoveryManager.getInstance().initComponent(this.instanceConfig, this.clientConfig); DiscoveryManager.getInstance().initComponent(this.instanceConfig,
this.clientConfig);
this.lifecycle.start(); this.lifecycle.start();
} }
......
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