Browse Source

Fix broken test (assumptions about eureka-first)

pull/6/head
Dave Syer 10 years ago
parent
commit
3697ce7fd9
  1. 7
      spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/config/DiscoveryClientConfigServiceAutoConfigurationTests.java

7
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/config/DiscoveryClientConfigServiceAutoConfigurationTests.java

@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
@ -69,7 +70,7 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests { @@ -69,7 +70,7 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests {
DiscoveryClientConfigServiceAutoConfiguration.class).length);
Mockito.verify(this.client, times(2)).getNextServerFromEureka("CONFIGSERVER",
false);
Mockito.verify(this.client, times(0)).shutdown();
Mockito.verify(this.client, times(1)).shutdown();
ConfigClientProperties locator = this.context
.getBean(ConfigClientProperties.class);
assertEquals("http://foo:7001/", locator.getRawUri());
@ -89,7 +90,9 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests { @@ -89,7 +90,9 @@ public class DiscoveryClientConfigServiceAutoConfigurationTests {
parent.refresh();
this.context = new AnnotationConfigApplicationContext();
this.context.setParent(parent);
this.context.register(DiscoveryClientConfigServiceAutoConfiguration.class,
this.context.register(PropertyPlaceholderAutoConfiguration.class,
DiscoveryClientConfigServiceAutoConfiguration.class,
EurekaClientAutoConfiguration.class,
EurekaDiscoveryClientConfiguration.class);
this.context.refresh();
}

Loading…
Cancel
Save