Skip to content

Commit 42fe8c1

Browse files
committed
Document effect of user configuration on slicing
Closes gh-10709
1 parent 53335c0 commit 42fe8c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5398,6 +5398,12 @@ The search algorithm works up from the package that contains the test until it f
53985398
<<using-boot-structuring-your-code, structured your code>> in a sensible way your main
53995399
configuration is usually found.
54005400

5401+
NOTE: If you use a <<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests,
5402+
test annotation to test a more specific slice of your application>> with such setup, any
5403+
user configuration defined on your `@SpringBootApplication` will be processed. This can
5404+
break the purpose of slicing and it is recommended to move such configuration to a
5405+
`@Configuration` class alongside your `@SpringBootApplication`.
5406+
54015407
If you want to customize the primary configuration, you can use a nested
54025408
`@TestConfiguration` class. Unlike a nested `@Configuration` class which would be used
54035409
instead of a your application's primary configuration, a nested `@TestConfiguration` class

0 commit comments

Comments
 (0)