diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java index f298941f2a..56cd4ed0a6 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java @@ -132,11 +132,13 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilderNormally {@code @ControllerAdvice} are auto-detected. However since the - * standalone setup does not load Spring configuration they need to be - * registered explicitly instead. + * Register one or more + * {@link org.springframework.web.bind.annotation.ControllerAdvice + * ControllerAdvice} instances to be used in tests. + *

Normally {@code @ControllerAdvice} are auto-detected as long as they're + * declared as Spring beans. However since the standalone setup does not load + * any Spring configuration they need to be registered explicitly here + * instead much like controllers. * @since 4.2 */ public StandaloneMockMvcBuilder setControllerAdvice(Object... controllerAdvice) {