Class HttpHandlerConnector

java.lang.Object
org.springframework.test.web.reactive.server.HttpHandlerConnector
All Implemented Interfaces:
org.springframework.http.client.reactive.ClientHttpConnector

public class HttpHandlerConnector extends Object implements org.springframework.http.client.reactive.ClientHttpConnector
Connector that handles requests by invoking an HttpHandler rather than making actual requests to a network socket.

Internally the connector uses and adapts
MockClientHttpRequest and MockClientHttpResponse to
MockServerHttpRequest and MockServerHttpResponse.

Since:
5.0
Author:
Rossen Stoyanchev, Sam Brannen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Indicates that an error occurred after the server response was completed, via ReactiveHttpOutputMessage.writeWith(Publisher) or ReactiveHttpOutputMessage.setComplete(), and can no longer be changed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpHandlerConnector(org.springframework.http.server.reactive.HttpHandler handler)
    Construct an HttpHandlerConnector with the supplied HttpHandler to handle requests with.
    HttpHandlerConnector(org.springframework.http.server.reactive.HttpHandler handler, @Nullable org.springframework.http.server.reactive.SslInfo sslInfo)
    Construct an HttpHandlerConnector with the supplied SslInfo and HttpHandler to handle requests with.
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<org.springframework.http.client.reactive.ClientHttpResponse>
    connect(org.springframework.http.HttpMethod httpMethod, URI uri, Function<? super org.springframework.http.client.reactive.ClientHttpRequest, reactor.core.publisher.Mono<Void>> requestCallback)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpHandlerConnector

      public HttpHandlerConnector(org.springframework.http.server.reactive.HttpHandler handler)
      Construct an HttpHandlerConnector with the supplied HttpHandler to handle requests with.
    • HttpHandlerConnector

      public HttpHandlerConnector(org.springframework.http.server.reactive.HttpHandler handler, @Nullable org.springframework.http.server.reactive.SslInfo sslInfo)
      Construct an HttpHandlerConnector with the supplied SslInfo and HttpHandler to handle requests with.
      Since:
      7.0
  • Method Details

    • connect

      public reactor.core.publisher.Mono<org.springframework.http.client.reactive.ClientHttpResponse> connect(org.springframework.http.HttpMethod httpMethod, URI uri, Function<? super org.springframework.http.client.reactive.ClientHttpRequest, reactor.core.publisher.Mono<Void>> requestCallback)
      Specified by:
      connect in interface org.springframework.http.client.reactive.ClientHttpConnector