mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Previously, SpringBootContextLoader configured the environment with the test property sources using an ApplicationContextInitializer. This was because TestPropertySourceUtils did not provide a method to directly configure the environment using properties files, it had to be done via an application context. An unwanted side-effect of this was that the test property sources were not being configured before ConfigFileApplicationListener examined the environment to determine the name and locations of the files that it should be loading. This commit takes advantage of a new method that was added to TestPropertySourceUtils which allows properties files to be added directly to the environment without using an application context. This means that the use of the ApplicationContextInitializer can be removed and the test property sources can be applied to the environment before the application context is created. Closes gh-5728 |
||
---|---|---|
.. | ||
src | ||
pom.xml |