Default appName to 'application'.

This commit is contained in:
Spencer Gibb
2016-04-01 18:01:48 -06:00
parent 1e71c5632c
commit 5b8b461853
2 changed files with 2 additions and 1 deletions

View File

@@ -170,7 +170,7 @@ public abstract class AbstractDiscoveryLifecycle implements DiscoveryLifecycle,
* @return the app name, currently the spring.application.name property
*/
protected String getAppName() {
return this.environment.getProperty("spring.application.name");
return this.environment.getProperty("spring.application.name", "application");
}
@Override

View File

@@ -37,6 +37,7 @@ public class AbstractDiscoveryLifecycleTests {
assertEquals("Lifecycle port is wrong", port, lifecycle.getPort().get());
assertTrue("Lifecycle not running", lifecycle.isRunning());
assertTrue("Lifecycle not registered", lifecycle.isRegistered());
assertEquals("Lifecycle appName is wrong", "application", lifecycle.getAppName());
}
@EnableAutoConfiguration