Class MockMvcHttpConnector
java.lang.Object
org.springframework.test.web.servlet.client.MockMvcHttpConnector
- All Implemented Interfaces:
- ClientHttpConnector
Connector that handles requests by invoking a 
MockMvc rather than
 making actual requests over HTTP.- Since:
- 5.3
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Mono<ClientHttpResponse>connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, reactor.core.publisher.Mono<Void>> requestCallback) Connect to the origin server using the givenHttpMethodandURIand apply the givenrequestCallbackwhen the HTTP request of the underlying API can be initialized and written to.with(List<RequestPostProcessor> postProcessors) Create a new instance that applies the givenRequestPostProcessors to performed requests.
- 
Constructor Details- 
MockMvcHttpConnector
 
- 
- 
Method Details- 
connectpublic reactor.core.publisher.Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, reactor.core.publisher.Mono<Void>> requestCallback) Description copied from interface:ClientHttpConnectorConnect to the origin server using the givenHttpMethodandURIand apply the givenrequestCallbackwhen the HTTP request of the underlying API can be initialized and written to.- Specified by:
- connectin interface- ClientHttpConnector
- Parameters:
- method- the HTTP request method
- uri- the HTTP request URI
- requestCallback- a function that prepares and writes to the request, returning a publisher that signals when it's done writing. Implementations can return a- Mono<Void>by calling- ReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>)or- ReactiveHttpOutputMessage.setComplete().
- Returns:
- publisher for the ClientHttpResponse
 
- 
withCreate a new instance that applies the givenRequestPostProcessors to performed requests.- Since:
- 6.1
 
 
-