Commit 42fe8c1f authored by Stephane Nicoll's avatar Stephane Nicoll

Document effect of user configuration on slicing

Closes gh-10709
parent 53335c06
...@@ -5398,6 +5398,12 @@ The search algorithm works up from the package that contains the test until it f ...@@ -5398,6 +5398,12 @@ The search algorithm works up from the package that contains the test until it f
<<using-boot-structuring-your-code, structured your code>> in a sensible way your main <<using-boot-structuring-your-code, structured your code>> in a sensible way your main
configuration is usually found. configuration is usually found.
NOTE: If you use a <<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests,
test annotation to test a more specific slice of your application>> with such setup, any
user configuration defined on your `@SpringBootApplication` will be processed. This can
break the purpose of slicing and it is recommended to move such configuration to a
`@Configuration` class alongside your `@SpringBootApplication`.
If you want to customize the primary configuration, you can use a nested If you want to customize the primary configuration, you can use a nested
`@TestConfiguration` class. Unlike a nested `@Configuration` class which would be used `@TestConfiguration` class. Unlike a nested `@Configuration` class which would be used
instead of a your application's primary configuration, a nested `@TestConfiguration` class instead of a your application's primary configuration, a nested `@TestConfiguration` class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment