From 42fe8c1f389f327ec8fe30f0399a32a9eed79ebe Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 20 Oct 2017 08:41:47 +0200 Subject: [PATCH] Document effect of user configuration on slicing Closes gh-10709 --- .../src/main/asciidoc/spring-boot-features.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 7dbd28e04a..a2b1595fdc 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -5398,6 +5398,12 @@ The search algorithm works up from the package that contains the test until it f <> in a sensible way your main configuration is usually found. +NOTE: If you use a <> 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 `@TestConfiguration` class. Unlike a nested `@Configuration` class which would be used instead of a your application's primary configuration, a nested `@TestConfiguration` class