public final class MockServerWebExchange
extends org.springframework.web.server.adapter.DefaultServerWebExchange
DefaultServerWebExchange
for use in tests, along with
MockServerHttpRequest
and MockServerHttpResponse
.
See static factory methods to create an instance.
Modifier and Type | Class and Description |
---|---|
static class |
MockServerWebExchange.Builder
Builder for a
MockServerWebExchange . |
Modifier and Type | Method and Description |
---|---|
static MockServerWebExchange.Builder |
builder(MockServerHttpRequest.BaseBuilder<?> requestBuilder)
Variant of
builder(MockServerHttpRequest) with a mock request builder. |
static MockServerWebExchange.Builder |
builder(MockServerHttpRequest request)
Create a
MockServerWebExchange.Builder starting with the given mock request. |
static MockServerWebExchange |
from(MockServerHttpRequest.BaseBuilder<?> requestBuilder)
Variant of
from(MockServerHttpRequest) with a mock request builder. |
static MockServerWebExchange |
from(MockServerHttpRequest request)
Create a
MockServerWebExchange from the given mock request. |
MockServerHttpResponse |
getResponse() |
addUrlTransformer, checkNotModified, checkNotModified, checkNotModified, getApplicationContext, getAttributes, getFormData, getLocaleContext, getLogPrefix, getMultipartData, getPrincipal, getRequest, getSession, isNotModified, transformUrl
public MockServerHttpResponse getResponse()
getResponse
in interface org.springframework.web.server.ServerWebExchange
getResponse
in class org.springframework.web.server.adapter.DefaultServerWebExchange
public static MockServerWebExchange from(MockServerHttpRequest request)
MockServerWebExchange
from the given mock request.request
- the request to use.public static MockServerWebExchange from(MockServerHttpRequest.BaseBuilder<?> requestBuilder)
from(MockServerHttpRequest)
with a mock request builder.requestBuilder
- the builder for the mock request.public static MockServerWebExchange.Builder builder(MockServerHttpRequest request)
MockServerWebExchange.Builder
starting with the given mock request.request
- the request to use.public static MockServerWebExchange.Builder builder(MockServerHttpRequest.BaseBuilder<?> requestBuilder)
builder(MockServerHttpRequest)
with a mock request builder.requestBuilder
- the builder for the mock request.