From 7096d6c36a2393c2b59dd871772d2adedeb799cb Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 3 Nov 2017 16:40:39 +0000 Subject: [PATCH] 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. --- .../config/BootstrapConfigurationTests.java | 15 ++------------- .../src/test/resources/application.properties | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java index fe151f9c..ac49a2b2 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java @@ -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; } diff --git a/spring-cloud-context/src/test/resources/application.properties b/spring-cloud-context/src/test/resources/application.properties index d6aa5969..e0b7bee4 100644 --- a/spring-cloud-context/src/test/resources/application.properties +++ b/spring-cloud-context/src/test/resources/application.properties @@ -3,4 +3,3 @@ delay: 0 debug: true #logging.level.org.springframework.web: DEBUG #logging.level.org.springframework.context.annotation: DEBUG -management.security.enabled=false