-
Notifications
You must be signed in to change notification settings - Fork 40.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify SpringApplication Environment rather than setting it
Update `SpringBootContextLoader` so that when possible the `SpringApplication` remains in control of creating the `Environment` instance. Prior to this commit, we would always create the `Environment` in the `SpringBootContextLoader` and then call `setEnvironment` on the `SpringApplication`. This meant that the `ApplicationEnvironment` classes were not used and that `isCustomEnvironment` was set to `true` so no conversion was applied. With the updated code, an `ApplicationListener` is used to mutate the `Environment` instance and add the required test property sources. Fixes gh-29169
- Loading branch information
Showing
3 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters