Skip to content

Add method to TestPropertySourceUtils to add properties files directly to the environment [SPR-14131] #18703

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-14131 and commented

TestPropertySourceUtils allows inlined properties to be added straight to a ConfigurableEnvironment but only allows properties file to be added to the environment via a ConfigurableApplicationContext.

In Boot we'd like to create and configure the environment, set it on SpringApplication and then run the application which creates the application context. However,
due to the current functionality provided by TestPropertySourceUtils, we're using an ApplicationContextInitializer to defer configuring the environment until the context has been created (see spring-projects/spring-boot@69b0829) so that we have a ConfigurableApplicationContext to pass to TestPropertySourceUtils.


Referenced from: commits 463c8f1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions