-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an MockMVC alwaysDo equivalent to WebTestClient #26662
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Mar 11, 2021
The challenge is that the body could be decoded in different ways, e.g. to a |
rstoyanchev
added
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Mar 11, 2021
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2021
This was referenced Mar 16, 2021
This was referenced Mar 16, 2021
This was referenced Mar 17, 2021
Closed
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
In Spring Cloud Contract we're generating tests for our users. Typically what is being used is the RestAssured library for sending out HTTP requests. RestAssured has a MockMVC and WebTestClient extensions. The users can't modify the generated tests - what they can do is to write code in the base class that the generated test extends.
With MockMVC I could do the following
Notice the
.alwaysDo(document(getClass().getSimpleName() + "_" + testInfo.getDisplayName()))
part. We are running this assertion for each test method and each MockMVC call.I'd like to achieve sth similar for
WebTestClient
.I can write this:
This is a fine way of hooking RestDocs to WebTestClient. I can't however make the global
consumeWith(...)
call like in the RestDocs snippetIt would be great to add sch a functionality.
cc @wilkinsona
Related issue:
spring-cloud-samples/spring-cloud-contract-samples#106
The text was updated successfully, but these errors were encountered: