Commit 24288691 by Dave Syer

Fix test in build server VM

parent a5d2d2ab
...@@ -111,8 +111,9 @@ public class EurekaInstanceConfigBeanTests { ...@@ -111,8 +111,9 @@ public class EurekaInstanceConfigBeanTests {
public void testPerferIpAddress() throws Exception { public void testPerferIpAddress() throws Exception {
addEnvironment(context, "eureka.instance.preferIpAddress:true"); addEnvironment(context, "eureka.instance.preferIpAddress:true");
setupContext(); setupContext();
assertTrue("Wrong hostname: " + getInstanceConfig().getHostname(), EurekaInstanceConfigBean instance = getInstanceConfig();
getInstanceConfig().getHostname().startsWith("127.0.")); assertTrue("Wrong hostname: " + instance.getHostname(),
getInstanceConfig().getHostname().equals(instance.getIpAddress()));
} }
...@@ -120,8 +121,9 @@ public class EurekaInstanceConfigBeanTests { ...@@ -120,8 +121,9 @@ public class EurekaInstanceConfigBeanTests {
public void testPerferIpAddressInDatacenter() throws Exception { public void testPerferIpAddressInDatacenter() throws Exception {
addEnvironment(context, "eureka.instance.preferIpAddress:true"); addEnvironment(context, "eureka.instance.preferIpAddress:true");
setupContext(); setupContext();
String id = ((UniqueIdentifier) getInstanceConfig().getDataCenterInfo()).getId(); EurekaInstanceConfigBean instance = getInstanceConfig();
assertTrue("Wrong hostname: " + id, id.startsWith("127.0.")); String id = ((UniqueIdentifier) instance.getDataCenterInfo()).getId();
assertTrue("Wrong hostname: " + id, id.equals(instance.getIpAddress()));
} }
......
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