Clarify that @AutoConfigureWebTestClient uses mock infrastructure

Closes gh-29890
This commit is contained in:
Andy Wilkinson
2023-10-30 11:12:25 +00:00
parent 0d8ea44f5b
commit f78dcac56f
2 changed files with 7 additions and 4 deletions

View File

@@ -200,7 +200,7 @@ For convenience, tests that need to make REST calls to the started server can ad
include::code:MyRandomPortWebTestClientTests[]
TIP: `WebTestClient` can be used against both live servers and <<features#features.testing.spring-boot-applications.with-mock-environment, mock environments>>.
TIP: `WebTestClient` can also used with a <<features#features.testing.spring-boot-applications.with-mock-environment, mock environment>>, removing the need for a running server, by annotating your test class with `@AutoConfigureWebTestClient`.
This setup requires `spring-webflux` on the classpath.
If you can not or will not add webflux, Spring Boot also provides a `TestRestTemplate` facility: