程序包 org.springframework.test.web.reactive.server
Support for testing Spring WebFlux server endpoints via
WebTestClient
.接口概要 接口 说明 MockServerConfigurer Contract that frameworks or applications can use to pre-package a set of customizations to aWebTestClient.MockServerSpec
and expose that as a shortcut.WebTestClient Client for testing web servers that usesWebClient
internally to perform requests while also providing a fluent API to verify responses.WebTestClient.BodyContentSpec Spec for expectations on the response body content.WebTestClient.BodySpec<B,S extends WebTestClient.BodySpec<B,S>> Spec for expectations on the response body decoded to a single Object.WebTestClient.Builder Steps for customizing theWebClient
used to test with, internally delegating to aWebClient.Builder
.WebTestClient.ControllerSpec Specification for customizing controller configuration equivalent to, and internally delegating to, aWebFluxConfigurer
.WebTestClient.ListBodySpec<E> Spec for expectations on the response body decoded to a List.WebTestClient.MockServerSpec<B extends WebTestClient.MockServerSpec<B>> Base specification for setting up tests without a server.WebTestClient.RequestBodySpec Specification for providing body of a request.WebTestClient.RequestBodyUriSpec Specification for providing the body and the URI of a request.WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>> Specification for adding request headers and performing an exchange.WebTestClient.RequestHeadersUriSpec<S extends WebTestClient.RequestHeadersSpec<S>> Specification for providing request headers and the URI of a request.WebTestClient.ResponseSpec Chained API for applying assertions to a response.WebTestClient.RouterFunctionSpec Specification for customizing router function configuration.WebTestClient.UriSpec<S extends WebTestClient.RequestHeadersSpec<?>> Specification for providing the URI of a request.WebTestClientConfigurer Contract that frameworks or applications can use to pre-package a set of customizations to aWebTestClient.Builder
and expose that as a shortcut.类概要 类 说明 EntityExchangeResult<T> ExchangeResult
sub-class that exposes the response body fully extracted to a representation of type<T>
.ExchangeResult Container for request and response details for exchanges performed throughWebTestClient
.FluxExchangeResult<T> ExchangeResult
variant with the response body decoded asFlux<T>
but not yet consumed.HeaderAssertions Assertions on headers of the response.HttpHandlerConnector Connector that handles requests by invoking anHttpHandler
rather than making actual requests to a network socket.JsonPathAssertions JsonPath assertions.StatusAssertions Assertions on the response status.XpathAssertions XPath assertions for theWebTestClient
.异常错误概要 异常错误 说明 HttpHandlerConnector.FailureAfterResponseCompletedException Indicates that an error occurred after the server response was completed, viaReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>)
orReactiveHttpOutputMessage.setComplete()
, and can no longer be changed.