You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Add properties files directly to environment in TestPropertySourceUtils
This commit introduces a new method in TestPropertySourceUtils that
allows properties files to be added directly to the environment without
the need for a ConfigurableApplicationContext upfront; however, a
ResourceLoader is still necessary.
Andy Wilkinson opened SPR-14131 and commented
TestPropertySourceUtils
allows inlined properties to be added straight to aConfigurableEnvironment
but only allows properties file to be added to the environment via aConfigurableApplicationContext
.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 anApplicationContextInitializer
to defer configuring the environment until the context has been created (see spring-projects/spring-boot@69b0829) so that we have aConfigurableApplicationContext
to pass toTestPropertySourceUtils
.Referenced from: commits 463c8f1
The text was updated successfully, but these errors were encountered: