From b1399db9940d9aa879f4e2c48ff96c2c04a8a387 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 11 Oct 2018 16:17:24 -0700 Subject: [PATCH] Add a warning about `webDriver` scope to the docs Update the reference documentation with a warning about the `webDriver` scope that we create. Closes gh-13093 --- .../src/main/asciidoc/spring-boot-features.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 1896bda8f9..46fc4bebc5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -6657,6 +6657,10 @@ that the driver exits after each test and that a new instance is injected. If yo not want this behavior, you can add `@Scope("singleton")` to your `WebDriver` `@Bean` definition. +WARNING: The `webDriver` scope created by Spring Boot will replace any user defined scope +of the same name. If you define your own `webDriver` scope you may find it stops working +when you use `@WebMvcTest`. + TIP: Sometimes writing Spring MVC tests is not enough; Spring Boot can help you run <>.