@Test public void setEnvironmentWithoutSpringApplicationNameShouldntChangeComponentName() { CereebroProperties c = new CereebroProperties(); c.getApplication().getComponent().setName("storm"); c.setEnvironment(new MockEnvironment()); Assert.assertEquals("storm", c.getApplication().getComponent().getName()); }
@Override public void setEnvironment(Environment env) { if (!StringUtils.hasText(application.getComponent().getName())) { RelaxedPropertyResolver springPropertyResolver = new RelaxedPropertyResolver(env, "spring.application."); String appName = springPropertyResolver.getProperty("name"); application.getComponent().setName(StringUtils.hasText(appName) ? appName : generateName()); } }
CereebroProperties implements EnvironmentAware { @Override public void setEnvironment(Environment env) { if (!StringUtils.hasText(application.getComponent().getName())) { RelaxedPropertyResolver springPropertyResolver = new RelaxedPropertyResolver(env, "spring.application."); String appName = springPropertyResolver.getProperty("name"); application.getComponent().setName(StringUtils.hasText(appName) ? appName : generateName()); } } }
CereebroProperties implements EnvironmentAware { @Override public void setEnvironment(Environment env) { if (!StringUtils.hasText(application.getComponent().getName())) { RelaxedPropertyResolver springPropertyResolver = new RelaxedPropertyResolver(env, "spring.application."); String appName = springPropertyResolver.getProperty("name"); application.getComponent().setName(StringUtils.hasText(appName) ? appName : generateName()); } }  }
CereebroProperties implements EnvironmentAware { @Override public void setEnvironment(Environment env) { if (!StringUtils.hasText(application.getComponent().getName())) { RelaxedPropertyResolver springPropertyResolver = new RelaxedPropertyResolver(env, "spring.application."); String appName = springPropertyResolver.getProperty("name"); application.getComponent().setName(StringUtils.hasText(appName) ? appName : generateName()); } }  @Override void setEnvironment(Environment env); }
CereebroProperties implements EnvironmentAware { @Override public void setEnvironment(Environment env) { if (!StringUtils.hasText(application.getComponent().getName())) { RelaxedPropertyResolver springPropertyResolver = new RelaxedPropertyResolver(env, "spring.application."); String appName = springPropertyResolver.getProperty("name"); application.getComponent().setName(StringUtils.hasText(appName) ? appName : generateName()); } }  @Override void setEnvironment(Environment env);  }