Add AssertJ support for MockMvc

This commit adds a new way to use MockMvc by returning a MvcResult that
is AssertJ compatible. Compared to the existing MockMvc infrastructure,
this new model has the following advantages:

* Can be created from a MockMvc instance
* Dedicated builder methods for easier setup
* Assertions use familiar AssertJ syntax with discoverable assertions
through a DSL
* Improved exception message

See gh-21178

Co-authored-by: Brian Clozel <brian.clozel@broadcom.com>
This commit is contained in:
Stéphane Nicoll
2024-03-15 13:30:16 +01:00
parent 555d4a6004
commit e7d7cb8641
8 changed files with 1536 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
{
"message": "hello"
}