Skip to content

Commit

Permalink
Document ConfigFile...Initializer limitations
Browse files Browse the repository at this point in the history
Update the reference documentation with a note about the limitations of
ConfigFileApplicationContextInitializer.

Fixes gh-6120
  • Loading branch information
philwebb committed Jul 15, 2016
1 parent 7b641d5 commit 51ede0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
Expand Up @@ -5370,6 +5370,12 @@ this when you don't need the full features provided by `@SpringBootTest`.
initializers = ConfigFileApplicationContextInitializer.class)
----

NOTE: Using `ConfigFileApplicationContextInitializer` alone won't provide support for
`@Value("${...}")` injection. Its only job is to ensure that `application.properties` files
are loaded into Spring's `Environment`. For `@Value` support you need to either
additionally configure a `PropertySourcesPlaceholderConfigurer` or use `@SpringBootTest`
where one will be auto-configured for you.



[[boot-features-environment-test-utilities]]
Expand Down

0 comments on commit 51ede0c

Please sign in to comment.