Commit 572220ae by Spencer Gibb

Default secureVirtualHostName to spring.application.name.

See gh-826
parent 48913cbb
......@@ -135,6 +135,7 @@ public class EurekaInstanceConfigBean implements CloudEurekaInstanceConfig {
* secure virtual host name.Think of this as similar to the fully qualified domain
* name, that the users of your services will need to find this instance.
*/
@Value("${spring.application.name:unknown}")
private String secureVirtualHostName;
/**
......
......@@ -176,6 +176,15 @@ public class EurekaInstanceConfigBeanTests {
}
@Test
public void testVirtualHostName() throws Exception {
addEnvironment(this.context, "spring.application.name:myapp");
setupContext();
assertEquals("virtualHostName wrong", "myapp", getInstanceConfig().getVirtualHostName());
assertEquals("secureVirtualHostName wrong", "myapp", getInstanceConfig().getSecureVirtualHostName());
}
private void setupContext() {
this.context.register(PropertyPlaceholderAutoConfiguration.class,
TestConfiguration.class);
......
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