Polish "Use constants for well-known scope names"

See gh-43065
This commit is contained in:
Andy Wilkinson
2024-11-08 10:02:28 +00:00
parent 03841b1229
commit 5d63335a5c
12 changed files with 26 additions and 24 deletions

View File

@@ -407,7 +407,7 @@ The following example uses HtmlUnit:
include::code:MyHtmlUnitTests[]
NOTE: By default, Spring Boot puts `WebDriver` beans in a special "`scope`" to ensure that the driver exits after each test and that a new instance is injected.
If you do not want this behavior, you can add `@Scope("singleton")` to your `WebDriver` `@Bean` definition.
If you do not want this behavior, you can add `@Scope(ConfigurableBeanFactory.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`.