More changes in Spring Boot

This time they changed the way spring.config.location is handled
so you have to repeat the default value if you want those to be
read as well.
This commit is contained in:
Dave Syer
2017-11-03 16:40:39 +00:00
parent 0d16cf0f83
commit 7096d6c36a
2 changed files with 2 additions and 14 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.cloud.bootstrap.config;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -83,7 +82,7 @@ public class BootstrapConfigurationTests {
this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
.sources(BareConfiguration.class)
.properties("spring.cloud.bootstrap.location:" + externalPropertiesPath)
.properties("spring.cloud.bootstrap.location=" + externalPropertiesPath)
.run();
assertEquals("externalPropertiesInfoName",
this.context.getEnvironment().getProperty("info.name"));
@@ -116,17 +115,7 @@ public class BootstrapConfigurationTests {
* @return
*/
private String getExternalProperties() {
String externalPropertiesPath = "";
File externalProperties = new File(
"src/test/resources/external-properties/bootstrap.properties");
if (externalProperties.exists()) {
externalPropertiesPath = externalProperties.getAbsolutePath();
}
else {
externalProperties = new File(
"spring-cloud-context/src/test/resources/external-properties/bootstrap.properties");
externalPropertiesPath = externalProperties.getAbsolutePath();
}
String externalPropertiesPath = "classpath:bootstrap.properties,classpath:external-properties/bootstrap.properties";
return externalPropertiesPath;
}