Rework @TestPropertySource changes introduced in commit d251b513
to restore compatibility with Spring Boot 1.1
- Only add the `server.port` property when no @IntegrationTest
annotation is found.
- Always add a default `spring.jmx.enabled=false` property.
- Restore the SpringApplicationContextLoader.getEnvironmentProperties
protected method.
- Remove the @IntegrationTest.properties attribute.
See gh-1697
@ -90,7 +91,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
@@ -90,7 +91,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
@ -101,36 +102,9 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
@@ -101,36 +102,9 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
application.setWebEnvironment(false);
}
application.setInitializers(initializers);
returnapplication.run();
}
// Instead of parsing the keys ourselves, we rely on standard handling
thrownewIllegalStateException("Unexpected could not load properties from '"
+content+"'",e);
}
for(Stringname:props.stringPropertyNames()){
properties.put(name,props.getProperty(name));
}
returnproperties;
}
@Override
publicvoidprocessContextConfiguration(
ContextConfigurationAttributesconfigAttributes){
@ -176,8 +150,52 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
@@ -176,8 +150,52 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {