Skip to content
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

Support for web test client #1078

Merged

Conversation

OlgaMaciaszek
Copy link
Contributor

This adds support for Spring WebTestClient-based RestAssured Tests.

I have tried to maintain the original API and structure as much as possible. I have extracted some things to a new, shared module in order to avoid duplication. Finally, I have added the implementation with WebTestClient underneath; it mostly uses the existing RestAssured api. I have added the possibility to create router-function-based instances, requests with uri function paramters and the possibility to add consumer, however, I have not added the possibility to return a WebTestClient response spec for the users to run WebTestClient- style assertions, cause I have to close the body content stream in order to extract the byte[] body response content which is the base for all RestAssured assertions, which closes the stream and users would get errors if they try to execute WebTestClient-style body content assertions against that.

Add `standaloneSetup()`, `given()`, `when()`, `and()` methods implementation.
Start moving code that can be reused to a commons module.
Start implementing `WebTesClientRequestSpecificationImpl`.
…ging

tests to WebTestClient returned headers. Implement setup for logging if
validation fails.
in `WebTestClientRequestLogSpecificationImpl`, add fixes to
`WebTestClientRequestSpecification` and `WebTestClientRequestSenderImpl`.
Add more tests for params, requests and request specification.
…ring

in order to enable custom content types. Add more tests.
`RequestLoggingTest`. Add `QueryParamTest`.
…lity

of returning responseSpec as trying to do body assertions on it would cause
issues, cause the stream has already been blocked to get the byte array response.
@OlgaMaciaszek
Copy link
Contributor Author

@johanhaleby I've filed the WebTestClient module PR as agreed. Please review.

@johanhaleby johanhaleby merged commit 9178668 into rest-assured:master Oct 11, 2018
@johanhaleby
Copy link
Collaborator

@OlgaMaciaszek Thanks a lot! Really impressive, great work! I'm so grateful for this contribution. I'll try to fix the docs as soon as a find time and then issue a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants