Introduced property 'spring.cloud.bootstrap.additional-location' according to 'spring.config.additional-location' (#466)
This commit is contained in:
@@ -72,7 +72,7 @@ public class BootstrapConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pickupExternalBootstrapProperties() {
|
||||
public void pickupOnlyExternalBootstrapProperties() {
|
||||
String externalPropertiesPath = getExternalProperties();
|
||||
|
||||
this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
|
||||
@@ -81,9 +81,27 @@ public class BootstrapConfigurationTests {
|
||||
.run();
|
||||
then(this.context.getEnvironment().getProperty("info.name"))
|
||||
.isEqualTo("externalPropertiesInfoName");
|
||||
then(this.context.getEnvironment().getProperty("info.desc")).isNull();
|
||||
then(this.context.getEnvironment().getPropertySources().contains(
|
||||
PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME))
|
||||
.isTrue();
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pickupAdditionalExternalBootstrapProperties() {
|
||||
String externalPropertiesPath = getExternalProperties();
|
||||
|
||||
this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
|
||||
.sources(BareConfiguration.class)
|
||||
.properties("spring.cloud.bootstrap.additional-location=" + externalPropertiesPath)
|
||||
.run();
|
||||
then(this.context.getEnvironment().getProperty("info.name"))
|
||||
.isEqualTo("externalPropertiesInfoName");
|
||||
then(this.context.getEnvironment().getProperty("info.desc"))
|
||||
.isEqualTo("defaultPropertiesInfoDesc");
|
||||
then(this.context.getEnvironment().getPropertySources().contains(
|
||||
PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME))
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -111,7 +129,7 @@ public class BootstrapConfigurationTests {
|
||||
* @return
|
||||
*/
|
||||
private String getExternalProperties() {
|
||||
String externalPropertiesPath = "classpath:bootstrap.properties,classpath:external-properties/bootstrap.properties";
|
||||
String externalPropertiesPath = "classpath:external-properties/bootstrap.properties";
|
||||
return externalPropertiesPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user