Interface WebTestClient


public interface WebTestClient
Client for testing web servers that uses WebClient internally to perform requests while also providing a fluent API to verify responses. This client can connect to any server over HTTP, or to a WebFlux application with a mock request and response.

Use one of the bindToXxx methods to create an instance. For example:

Since:
5.0
Author:
Rossen Stoyanchev, Brian Clozel, Sam Brannen, MichaƂ Rowicki
  • Field Details

    • WEBTESTCLIENT_REQUEST_ID

      static final String WEBTESTCLIENT_REQUEST_ID
      The name of a request header used to assign a unique id to every request performed through the WebTestClient. This can be useful for storing contextual information at all phases of request processing (for example, from a server-side component) under that id and later to look up that information once an ExchangeResult is available.
      See Also:
  • Method Details