From 7a8c8c062e7c8767fc1fbaae442f568685ffe83e Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 29 Sep 2017 20:21:01 -0400 Subject: [PATCH] Add reactive mocks to testing section --- src/docs/asciidoc/testing.adoc | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/docs/asciidoc/testing.adoc b/src/docs/asciidoc/testing.adoc index 22575272fe..a698922daf 100644 --- a/src/docs/asciidoc/testing.adoc +++ b/src/docs/asciidoc/testing.adoc @@ -77,14 +77,28 @@ The `org.springframework.mock.web` package contains a comprehensive set of Servl mock objects, which are useful for testing web contexts, controllers, and filters. These mock objects are targeted at usage with Spring's Web MVC framework and are generally more convenient to use than dynamic mock objects such as http://www.easymock.org[EasyMock] or -alternative Servlet API mock objects such as http://www.mockobjects.com[MockObjects]. Since -Spring Framework 5.0, the set of mocks in the `org.springframework.mock.web` package is -based on the Servlet 4.0 API. +alternative Servlet API mock objects such as http://www.mockobjects.com[MockObjects]. -For thorough integration testing of your Spring MVC and REST ``Controller``s in -conjunction with your `WebApplicationContext` configuration for Spring MVC, see the -<>. +[TIP] +==== +Since Spring Framework 5.0, the mock objects in `org.springframework.mock.web` are based +on the Servlet 4.0 API. +==== +The Spring MVC Test framework builds on the mock Servlet API objects to provide an +integration test framework for Spring MVC. See +<>. + + +[[mock-objects-web-reactive]] +==== Spring Web Reactive +The `org.springframework.mock.http.server.reactive` package contains mock request and +response objects for testing Spring WebFlux applications. There is also a +`MockWebServerExchange` in `org.springframework.mock.web.server` package that uses +those mock request and response. + +`WebTestClient` builds on these mock objects and to provide integration testing +of WebFlux server endpoints without running an HTTP server. [[unit-testing-support-classes]]