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 Type
    Method
    Description
    consumeWith(Consumer<org.springframework.test.web.reactive.server.EntityExchangeResult<byte[]>> consumer)
    Specify a Consumer to process the request result.
    delete(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a DELETE request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    get(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    Perform a GET request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    head(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a HEAD request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    options(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a OPTIONS request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    patch(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a PATCH request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    post(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    Perform a POST request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    put(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a PUT request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
    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 uses UriBuilder to generate URI.
    request(String method, Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
    * Perform a request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.

    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

      WebTestClientResponse get(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      Perform a GET request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • post

      WebTestClientResponse post(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      Perform a POST request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • put

      WebTestClientResponse put(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      * Perform a PUT request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • delete

      WebTestClientResponse delete(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      * Perform a DELETE request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • patch

      WebTestClientResponse patch(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      * Perform a PATCH request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • head

      WebTestClientResponse head(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      * Perform a HEAD request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      Parameters:
      uriFunction - The function that will be used for evaluating the URI.
      Returns:
      The response of the request.
    • options

      WebTestClientResponse options(Function<org.springframework.web.util.UriBuilder,URI> uriFunction)
      * Perform a OPTIONS request to a uri obtained from a {@link Function<>} that uses UriBuilder to generate URI.
      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 uses UriBuilder to generate URI.
      Parameters:
      method - The HTTP method to use while sending the request expressed as Method
      uriFunction - 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 uses UriBuilder to generate URI.
      Parameters:
      method - The HTTP method to use while sending the request expressed as String
      uriFunction - 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 a 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")
       
      Parameters:
      consumer - to be applied on the exchange result.
      Returns:
      a WebTestClientRequestSender instance.