Interface WebTestClientRequestSender
- All Superinterfaces:
io.restassured.specification.RequestSenderOptions<WebTestClientResponse>
- All Known Subinterfaces:
WebTestClientRequestSpecification
- All Known Implementing Classes:
WebTestClientRequestSenderImpl,WebTestClientRequestSpecificationImpl
public interface WebTestClientRequestSender
extends io.restassured.specification.RequestSenderOptions<WebTestClientResponse>
-
Method Summary
Modifier and TypeMethodDescriptionconsumeWith(Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer) Specify aConsumerto process the request result.* Perform a DELETE request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.Perform a GET request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.* Perform a HEAD request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.* Perform a OPTIONS request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.* Perform a PATCH request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.Perform a POST request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.* Perform a PUT request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.request(io.restassured.http.Method method, Function<org.springframework.web.util.UriBuilder, URI> uriFunction) * Perform a request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.* Perform a request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.Methods inherited from interface io.restassured.specification.RequestSenderOptions
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
-
Method Details
-
get
Perform a GET request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
post
Perform a POST request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
put
* Perform a PUT request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
delete
* Perform a DELETE request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
patch
* Perform a PATCH request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
head
* Perform a HEAD request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
options
* Perform a OPTIONS request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
uriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
request
WebTestClientResponse request(io.restassured.http.Method method, Function<org.springframework.web.util.UriBuilder, URI> uriFunction) * Perform a request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
method- The HTTP method to use while sending the request expressed asMethoduriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
request
WebTestClientResponse request(String method, Function<org.springframework.web.util.UriBuilder, URI> uriFunction) * Perform a request to a uri obtained from a {@link Function<>} that usesUriBuilderto generateURI.- Parameters:
method- The HTTP method to use while sending the request expressed asStringuriFunction- The function that will be used for evaluating the URI.- Returns:
- The response of the request.
-
consumeWith
WebTestClientRequestSender consumeWith(Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer) Specify aConsumerto process the request result. The consumer will be applied before processing the result into aWebTestClientResponseand 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")- Parameters:
consumer- to be applied on the exchange result.- Returns:
- a
WebTestClientRequestSenderinstance.
-