public interface WebTestClientRequestSender extends io.restassured.specification.RequestSenderOptions<WebTestClientResponse>
Modifier and Type | Method and Description |
---|---|
WebTestClientRequestSender |
consumeWith(java.util.function.Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer)
Specify a
Consumer to process the request result. |
WebTestClientResponse |
delete(java.util.function.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(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
head(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
options(java.util.function.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(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
post(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
put(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
request(io.restassured.http.Method method,
java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
|
WebTestClientResponse |
request(String method,
java.util.function.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, request
WebTestClientResponse get(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse post(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse put(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse delete(java.util.function.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(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse head(java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse options(java.util.function.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, java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
method
- The HTTP method to use while sending the request expressed as Method
uriFunction
- The function that will be used for evaluating the URI.WebTestClientResponse request(String method, java.util.function.Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
method
- The HTTP method to use while sending the request expressed as String
uriFunction
- The function that will be used for evaluating the URI.WebTestClientRequestSender consumeWith(java.util.function.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–2020. All rights reserved.