public interface WebTestClientRequestSender extends io.restassured.specification.RequestSenderOptions<WebTestClientResponse>
| Modifier and Type | Method and Description |
|---|---|
WebTestClientRequestSender |
consumeWith(Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer)
Specify a
Consumer to process the request result. |
WebTestClientResponse |
delete(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
* Perform a DELETE request to a uri obtained from a
Function<> that uses UriBuilder
to generate URI. |
WebTestClientResponse |
get(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
head(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
options(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
* Perform a OPTIONS request to a uri obtained from a
Function<> that uses UriBuilder
to generate URI. |
WebTestClientResponse |
patch(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
post(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
put(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
request(io.restassured.http.Method method,
Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
request(String method,
Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
delete, delete, delete, delete, delete, get, get, get, get, get, head, head, head, head, head, options, options, options, options, options, patch, patch, patch, patch, patch, post, post, post, post, post, put, put, put, put, put, request, request, request, request, request, request, request, requestWebTestClientResponse get(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse post(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse put(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse delete(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
Function<> that uses UriBuilder
to generate URI.uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse patch(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse head(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse options(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
Function<> that uses UriBuilder
to generate URI.uriFunction - The function that will be used for evaluating the URI.WebTestClientResponse request(io.restassured.http.Method method, Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
method - The HTTP method to use while sending the request expressed as MethoduriFunction - The function that will be used for evaluating the URI.WebTestClientResponse request(String method, Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
method - The HTTP method to use while sending the request expressed as StringuriFunction - The function that will be used for evaluating the URI.WebTestClientRequestSender consumeWith(Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer)
Consumer to process the request result. The consumer will be applied before processing the result
into a WebTestClientResponse and before extracting the response body content as byte array, which closes
the stream.
This is very useful, for example for extracting Spring Rest Docs.
Usage example:
RestAssuredWebTestClient.given()
.standaloneSetup(new GreetingController(), documentationConfiguration(restDocumentation))
.queryParam("name", "John")
.when()
.consumeWith(document("greeting",
pathParameters(
parameterWithName("path").description("The path to greeting")),
responseFields(
fieldWithPath("id").description("The ID of the greeting"),
fieldWithPath("content").description("The content of the greeting"))
))
.get("/{path}", "greeting")
consumer - to be applied on the exchange result.WebTestClientRequestSender instance.Copyright © 2010–2025. All rights reserved.