类 MockServerHttpRequest
java.lang.Object
cn.taketoday.http.server.reactive.AbstractServerHttpRequest
cn.taketoday.mock.http.server.reactive.MockServerHttpRequest
- 所有已实现的接口:
cn.taketoday.http.HttpMessage,cn.taketoday.http.HttpRequest,cn.taketoday.http.ReactiveHttpInputMessage,cn.taketoday.http.server.reactive.ServerHttpRequest
public final class MockServerHttpRequest
extends cn.taketoday.http.server.reactive.AbstractServerHttpRequest
Mock extension of
AbstractServerHttpRequest for use in tests without
an actual server. Use the static methods to obtain a builder.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceRequest builder exposing properties not related to the body.static interfaceA builder that adds a body to the request.private static class从接口继承的嵌套类/接口 cn.taketoday.http.server.reactive.ServerHttpRequest
cn.taketoday.http.server.reactive.ServerHttpRequest.Builder -
字段概要
字段修饰符和类型字段说明private final reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer>private final cn.taketoday.util.MultiValueMap<String,cn.taketoday.http.HttpCookie> private final cn.taketoday.http.HttpMethodprivate final InetSocketAddressprivate final InetSocketAddressprivate final cn.taketoday.http.server.reactive.SslInfo -
构造器概要
构造器限定符构造器说明privateMockServerHttpRequest(cn.taketoday.http.HttpMethod httpMethod, URI uri, String contextPath, cn.taketoday.http.HttpHeaders headers, cn.taketoday.util.MultiValueMap<String, cn.taketoday.http.HttpCookie> cookies, InetSocketAddress localAddress, InetSocketAddress remoteAddress, cn.taketoday.http.server.reactive.SslInfo sslInfo, org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) -
方法概要
修饰符和类型方法说明static MockServerHttpRequest.BaseBuilder<?>HTTP DELETE variant.static MockServerHttpRequest.BaseBuilder<?>Create an HTTP GET builder with the given URI template.reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer>getBody()cn.taketoday.http.HttpMethod<T> Tstatic MockServerHttpRequest.BaseBuilder<?>HTTP HEAD variant.protected cn.taketoday.util.MultiValueMap<String,cn.taketoday.http.HttpCookie> protected cn.taketoday.http.server.reactive.SslInfoAlternative tomethod(HttpMethod, URI)that accepts a URI template.Create a builder with the given HTTP method and aURI.已过时。static MockServerHttpRequest.BaseBuilder<?>HTTP OPTIONS variant.HTTP PATCH variant.HTTP POST variant.HTTP PUT variant.private static URI从类继承的方法 cn.taketoday.http.server.reactive.AbstractServerHttpRequest
getCookies, getHeaders, getId, getPath, getQueryParams, getSslInfo, getURI, initId, initLogPrefix, initQueryParams从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpRequest
getMethodValue从接口继承的方法 cn.taketoday.http.server.reactive.ServerHttpRequest
mutate
-
字段详细资料
-
httpMethod
private final cn.taketoday.http.HttpMethod httpMethod -
cookies
-
localAddress
-
remoteAddress
-
sslInfo
@Nullable private final cn.taketoday.http.server.reactive.SslInfo sslInfo -
body
private final reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> body
-
-
构造器详细资料
-
MockServerHttpRequest
private MockServerHttpRequest(cn.taketoday.http.HttpMethod httpMethod, URI uri, @Nullable String contextPath, cn.taketoday.http.HttpHeaders headers, cn.taketoday.util.MultiValueMap<String, cn.taketoday.http.HttpCookie> cookies, @Nullable InetSocketAddress localAddress, @Nullable InetSocketAddress remoteAddress, @Nullable cn.taketoday.http.server.reactive.SslInfo sslInfo, org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body)
-
-
方法详细资料
-
getMethod
public cn.taketoday.http.HttpMethod getMethod()- 指定者:
getMethod在接口中cn.taketoday.http.HttpRequest- 覆盖:
getMethod在类中cn.taketoday.http.server.reactive.AbstractServerHttpRequest
-
getLocalAddress
-
getRemoteAddress
-
initSslInfo
@Nullable protected cn.taketoday.http.server.reactive.SslInfo initSslInfo()- 指定者:
initSslInfo在类中cn.taketoday.http.server.reactive.AbstractServerHttpRequest
-
getBody
public reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> getBody() -
initCookies
- 指定者:
initCookies在类中cn.taketoday.http.server.reactive.AbstractServerHttpRequest
-
getNativeRequest
public <T> T getNativeRequest()- 指定者:
getNativeRequest在类中cn.taketoday.http.server.reactive.AbstractServerHttpRequest
-
get
Create an HTTP GET builder with the given URI template. The given URI may contain query parameters, or those may be added later viaqueryParambuilder methods.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
head
HTTP HEAD variant. Seeget(String, Object...)for general info.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
post
HTTP POST variant. Seeget(String, Object...)for general info.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
put
HTTP PUT variant. Seeget(String, Object...)for general info.queryParambuilder methods.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
patch
HTTP PATCH variant. Seeget(String, Object...)for general info.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
delete
HTTP DELETE variant. Seeget(String, Object...)for general info.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
options
HTTP OPTIONS variant. Seeget(String, Object...)for general info.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVars- zero or more URI variables- 返回:
- the created builder
-
method
public static MockServerHttpRequest.BodyBuilder method(cn.taketoday.http.HttpMethod method, URI url) Create a builder with the given HTTP method and aURI.- 参数:
method- the HTTP method (GET, POST, etc)url- the URL- 返回:
- the created builder
-
method
public static MockServerHttpRequest.BodyBuilder method(cn.taketoday.http.HttpMethod method, String uri, Object... vars) Alternative tomethod(HttpMethod, URI)that accepts a URI template. The given URI may contain query parameters, or those may be added later viaqueryParambuilder methods.- 参数:
method- the HTTP method (GET, POST, etc)uri- the URI template for the target URLvars- variables to expand into the template- 返回:
- the created builder
-
method
@Deprecated public static MockServerHttpRequest.BodyBuilder method(String httpMethod, String uri, Object... vars) 已过时。in favor ofmethod(HttpMethod, String, Object...)Create a builder with a raw HTTP method value value that is outside the range ofHttpMethodenum values.- 参数:
httpMethod- the HTTP methodValue valueuri- the URI template for target the URLvars- variables to expand into the template- 返回:
- the created builder
-
toUri
-
method(HttpMethod, String, Object...)