@Test public void applicationNameIsUnknown() { CoffeeNetConfigurationProperties coffeeNetConfigurationProperties = new CoffeeNetConfigurationProperties(); coffeeNetConfigurationProperties.setApplicationName(""); CoffeeNetDiscoveryInstanceProperties sut = new CoffeeNetDiscoveryInstanceProperties(new InetUtils( new InetUtilsProperties()), coffeeNetConfigurationProperties); sut.setEnvironment(new MockEnvironment()); String unknownApplicationName = "unknown"; assertThat(sut.getAppname(), is(unknownApplicationName)); assertThat(sut.getVirtualHostName(), is(unknownApplicationName)); assertThat(sut.getSecureVirtualHostName(), is(unknownApplicationName)); }
@Override public void setEnvironment(Environment environment) { String applicationName = coffeeNetConfigurationProperties.getApplicationName(); if (StringUtils.hasText(applicationName)) { this.setAppname(applicationName); this.setVirtualHostName(applicationName); this.setSecureVirtualHostName(applicationName); } }
CoffeeNetDiscoveryInstanceProperties extends EurekaInstanceConfigBean { @Override public void setEnvironment(Environment environment) { String applicationName = coffeeNetConfigurationProperties.getApplicationName(); if (StringUtils.hasText(applicationName)) { this.setAppname(applicationName); this.setVirtualHostName(applicationName); this.setSecureVirtualHostName(applicationName); } } }
CoffeeNetDiscoveryInstanceProperties extends EurekaInstanceConfigBean { @Override public void setEnvironment(Environment environment) { String applicationName = coffeeNetConfigurationProperties.getApplicationName(); if (StringUtils.hasText(applicationName)) { this.setAppname(applicationName); this.setVirtualHostName(applicationName); this.setSecureVirtualHostName(applicationName); } } CoffeeNetDiscoveryInstanceProperties(InetUtils inetUtils,
        CoffeeNetConfigurationProperties coffeeNetConfigurationProperties); }
CoffeeNetDiscoveryInstanceProperties extends EurekaInstanceConfigBean { @Override public void setEnvironment(Environment environment) { String applicationName = coffeeNetConfigurationProperties.getApplicationName(); if (StringUtils.hasText(applicationName)) { this.setAppname(applicationName); this.setVirtualHostName(applicationName); this.setSecureVirtualHostName(applicationName); } } CoffeeNetDiscoveryInstanceProperties(InetUtils inetUtils,
        CoffeeNetConfigurationProperties coffeeNetConfigurationProperties); @Override String getHostname(); @Override void setHostname(String hostname); @Override void setEnvironment(Environment environment); @Override String toString(); }
CoffeeNetDiscoveryInstanceProperties extends EurekaInstanceConfigBean { @Override public void setEnvironment(Environment environment) { String applicationName = coffeeNetConfigurationProperties.getApplicationName(); if (StringUtils.hasText(applicationName)) { this.setAppname(applicationName); this.setVirtualHostName(applicationName); this.setSecureVirtualHostName(applicationName); } } CoffeeNetDiscoveryInstanceProperties(InetUtils inetUtils,
        CoffeeNetConfigurationProperties coffeeNetConfigurationProperties); @Override String getHostname(); @Override void setHostname(String hostname); @Override void setEnvironment(Environment environment); @Override String toString();  }