public class MockServerHttpRequest extends Object implements org.springframework.http.server.reactive.ServerHttpRequest
ServerHttpRequest.| Constructor and Description |
|---|
MockServerHttpRequest()
Create a new instance where the HTTP method and/or URL can be set later
via
setHttpMethod(HttpMethod) and setUri(URI). |
MockServerHttpRequest(org.springframework.http.HttpMethod httpMethod,
String url)
Convenience alternative to
MockServerHttpRequest(HttpMethod, URI)
that accepts a String URL. |
MockServerHttpRequest(org.springframework.http.HttpMethod httpMethod,
URI url)
Create a new instance with the given HTTP method and URL.
|
| Modifier and Type | Method and Description |
|---|---|
MockServerHttpRequest |
addHeader(String name,
String value) |
reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> |
getBody() |
String |
getContextPath() |
org.springframework.util.MultiValueMap<String,org.springframework.http.HttpCookie> |
getCookies() |
org.springframework.http.HttpHeaders |
getHeaders() |
org.springframework.http.HttpMethod |
getMethod() |
org.springframework.util.MultiValueMap<String,String> |
getQueryParams() |
URI |
getURI() |
MockServerHttpRequest |
setBody(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> body) |
MockServerHttpRequest |
setBody(String body) |
MockServerHttpRequest |
setBody(String body,
Charset charset) |
void |
setContextPath(String contextPath) |
MockServerHttpRequest |
setHeader(String name,
String value) |
void |
setHttpMethod(org.springframework.http.HttpMethod httpMethod) |
MockServerHttpRequest |
setUri(String url) |
MockServerHttpRequest |
setUri(URI uri) |
public MockServerHttpRequest()
setHttpMethod(HttpMethod) and setUri(URI).public MockServerHttpRequest(org.springframework.http.HttpMethod httpMethod,
String url)
MockServerHttpRequest(HttpMethod, URI)
that accepts a String URL.public MockServerHttpRequest(org.springframework.http.HttpMethod httpMethod,
URI url)
public void setHttpMethod(org.springframework.http.HttpMethod httpMethod)
public org.springframework.http.HttpMethod getMethod()
getMethod in interface org.springframework.http.HttpRequestpublic MockServerHttpRequest setUri(String url)
public MockServerHttpRequest setUri(URI uri)
public URI getURI()
getURI in interface org.springframework.http.HttpRequestpublic void setContextPath(String contextPath)
public String getContextPath()
getContextPath in interface org.springframework.http.server.reactive.ServerHttpRequestpublic MockServerHttpRequest addHeader(String name, String value)
public MockServerHttpRequest setHeader(String name, String value)
public org.springframework.http.HttpHeaders getHeaders()
getHeaders in interface org.springframework.http.HttpMessagepublic org.springframework.util.MultiValueMap<String,String> getQueryParams()
getQueryParams in interface org.springframework.http.server.reactive.ServerHttpRequestpublic org.springframework.util.MultiValueMap<String,org.springframework.http.HttpCookie> getCookies()
getCookies in interface org.springframework.http.server.reactive.ServerHttpRequestpublic MockServerHttpRequest setBody(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> body)
public MockServerHttpRequest setBody(String body)
public MockServerHttpRequest setBody(String body, Charset charset)
public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> getBody()
getBody in interface org.springframework.http.ReactiveHttpInputMessage