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

parent 9125f548
......@@ -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());
......@@ -190,6 +190,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();
assertEquals("default app name is wrong", "unknown", getInstanceConfig().getAppname());
......
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