Browse Source

Add test to make sure eureka.instance.*virtualHostName can be set properly.

pull/6/head
Spencer Gibb 8 years ago
parent
commit
c380039b3e
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 12
      spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBeanTests.java

12
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBeanTests.java

@ -181,7 +181,7 @@ public class EurekaInstanceConfigBeanTests { @@ -181,7 +181,7 @@ public class EurekaInstanceConfigBeanTests {
}
@Test
public void testVirtualHostName() throws Exception {
public void testDefaultVirtualHostName() throws Exception {
addEnvironment(this.context, "spring.application.name:myapp");
setupContext();
assertEquals("virtualHostName wrong", "myapp", getInstanceConfig().getVirtualHostName());
@ -189,6 +189,16 @@ public class EurekaInstanceConfigBeanTests { @@ -189,6 +189,16 @@ public class EurekaInstanceConfigBeanTests {
}
@Test
public void testCustomVirtualHostName() throws Exception {
addEnvironment(this.context, "spring.application.name:myapp", "eureka.instance.virtualHostName=myvirthost",
"eureka.instance.secureVirtualHostName=mysecurevirthost");
setupContext();
assertEquals("virtualHostName wrong", "myvirthost", getInstanceConfig().getVirtualHostName());
assertEquals("secureVirtualHostName wrong", "mysecurevirthost", getInstanceConfig().getSecureVirtualHostName());
}
@Test
public void testDefaultAppName() throws Exception {
setupContext();

Loading…
Cancel
Save