类 HttpHandlerConnector
- java.lang.Object
- org.springframework.test.web.reactive.server.HttpHandlerConnector
- 所有已实现的接口:
ClientHttpConnector
public class HttpHandlerConnector extends Object implements ClientHttpConnector
Connector that handles requests by invoking anHttpHandler
rather than making actual requests to a network socket.Internally the connector uses and adapts
MockClientHttpRequest
andMockClientHttpResponse
toMockServerHttpRequest
andMockServerHttpResponse
.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
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.
构造器概要
构造器 构造器 说明 HttpHandlerConnector(HttpHandler handler)
Constructor with theHttpHandler
to handle requests with.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<ClientHttpResponse>
connect(HttpMethod httpMethod, URI uri, Function<? super ClientHttpRequest,reactor.core.publisher.Mono<Void>> requestCallback)
Connect to the origin server using the givenHttpMethod
andURI
and apply the givenrequestCallback
when the HTTP request of the underlying API can be initialized and written to.
构造器详细资料
HttpHandlerConnector
public HttpHandlerConnector(HttpHandler handler)
Constructor with theHttpHandler
to handle requests with.
方法详细资料
connect
public reactor.core.publisher.Mono<ClientHttpResponse> connect(HttpMethod httpMethod, URI uri, Function<? super ClientHttpRequest,reactor.core.publisher.Mono<Void>> requestCallback)
从接口复制的说明:ClientHttpConnector
Connect to the origin server using the givenHttpMethod
andURI
and apply the givenrequestCallback
when the HTTP request of the underlying API can be initialized and written to.- 指定者:
connect
在接口中ClientHttpConnector
- 参数:
httpMethod
- the HTTP request methoduri
- the HTTP request URIrequestCallback
- a function that prepares and writes to the request, returning a publisher that signals when it's done writing. Implementations can return aMono<Void>
by callingReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>)
orReactiveHttpOutputMessage.setComplete()
.- 返回:
- publisher for the
ClientHttpResponse