Files
spring-framework/framework-docs/modules/ROOT/pages/testing/mockmvc.adoc
Stéphane Nicoll d43dba63a1 Document AssertJ support for MockMvc
This commit restructures the section on MockMvc so that the anchors
are easier to read. The standard integration has moved to a
Hamcrest Integration section  at the same level as HtmlUnit Integration,
and a new AssertJ Integration section has been created.

Closes gh-32454
2024-06-21 12:51:35 +02:00

17 lines
769 B
Plaintext

[[mockmvc]]
= MockMvc
:page-section-summary-toc: 1
MockMvc provides support for testing Spring MVC applications. It performs full Spring MVC
request handling but via mock request and response objects instead of a running server.
MockMvc can be used on its own to perform requests and verify responses responses using
Hamcrest, or through `MockMvcTester` that provides a fluent API using AssertJ. Finally,
it can also be used through the xref:testing/webtestclient.adoc[WebTestClient] where
MockMvc is plugged in as the server to handle requests with. The advantage of
`WebTestClient` is the option to work with higher level objects instead of raw data as
well as the ability to switch to full, end-to-end HTTP tests against a live server and
use the same test API.