Interface MockServerHttpRequest.BaseBuilder<B extends MockServerHttpRequest.BaseBuilder<B>>
- Type Parameters:
B
- the builder subclass
- All Known Subinterfaces:
MockServerHttpRequest.BodyBuilder
- Enclosing class:
- MockServerHttpRequest
public static interface MockServerHttpRequest.BaseBuilder<B extends MockServerHttpRequest.BaseBuilder<B>>
Request builder exposing properties not related to the body.
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(org.springframework.http.MediaType... acceptableMediaTypes) Set the list of acceptable media types, as specified by theAccept
header.acceptCharset
(Charset... acceptableCharsets) Set the list of acceptable charsets, as specified by theAccept-Charset
header.acceptLanguageAsLocales
(Locale... acceptableLocales) Set the list of acceptable locales, as specified by theAccept-Languages
header.build()
Builds the request with no body.contextPath
(String contextPath) Set the contextPath to return.cookie
(org.springframework.http.HttpCookie... cookie) Add one or more cookies.Add the given cookies.Add the given, single header value under the given name.Add the given header values.ifModifiedSince
(long ifModifiedSince) Set the value of theIf-Modified-Since
header.ifNoneMatch
(String... ifNoneMatches) Set the values of theIf-None-Match
header.ifUnmodifiedSince
(long ifUnmodifiedSince) Set the (new) value of theIf-Unmodified-Since
header.localAddress
(InetSocketAddress localAddress) Set the local address to return.queryParam
(String name, Object... values) Append the given query parameter to the existing query parameters.queryParams
(org.springframework.util.MultiValueMap<String, String> params) Add the given query parameters and values.range
(org.springframework.http.HttpRange... ranges) Set the (new) value of the Range header.remoteAddress
(InetSocketAddress remoteAddress) Set the remote address to return.void
sslInfo
(org.springframework.http.server.reactive.SslInfo sslInfo) Set SSL session information and certificates.
-
Method Details
-
contextPath
Set the contextPath to return. -
queryParam
Append the given query parameter to the existing query parameters. If no values are given, the resulting URI will contain the query parameter name only (i.e.?foo
instead of?foo=bar
).The provided query name and values will be encoded.
- Parameters:
name
- the query parameter namevalues
- the query parameter values- Returns:
- this UriComponentsBuilder
-
queryParams
Add the given query parameters and values. The provided query name and corresponding values will be encoded.- Parameters:
params
- the params- Returns:
- this UriComponentsBuilder
-
remoteAddress
Set the remote address to return. -
localAddress
Set the local address to return.- Since:
- 5.2.3
-
sslInfo
void sslInfo(org.springframework.http.server.reactive.SslInfo sslInfo) Set SSL session information and certificates. -
cookie
Add one or more cookies. -
cookies
B cookies(org.springframework.util.MultiValueMap<String, org.springframework.http.HttpCookie> cookies) Add the given cookies.- Parameters:
cookies
- the cookies.
-
header
Add the given, single header value under the given name.- Parameters:
headerName
- the header nameheaderValues
- the header value(s)- See Also:
-
HttpHeaders.add(String, String)
-
headers
Add the given header values.- Parameters:
headers
- the header values
-
accept
Set the list of acceptable media types, as specified by theAccept
header.- Parameters:
acceptableMediaTypes
- the acceptable media types
-
acceptCharset
Set the list of acceptable charsets, as specified by theAccept-Charset
header.- Parameters:
acceptableCharsets
- the acceptable charsets
-
acceptLanguageAsLocales
Set the list of acceptable locales, as specified by theAccept-Languages
header.- Parameters:
acceptableLocales
- the acceptable locales
-
ifModifiedSince
Set the value of theIf-Modified-Since
header.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- Parameters:
ifModifiedSince
- the new value of the header
-
ifUnmodifiedSince
Set the (new) value of theIf-Unmodified-Since
header.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- Parameters:
ifUnmodifiedSince
- the new value of the header- See Also:
-
HttpHeaders.setIfUnmodifiedSince(long)
-
ifNoneMatch
Set the values of theIf-None-Match
header.- Parameters:
ifNoneMatches
- the new value of the header
-
range
Set the (new) value of the Range header.- Parameters:
ranges
- the HTTP ranges- See Also:
-
HttpHeaders.setRange(List)
-
build
MockServerHttpRequest build()Builds the request with no body.- Returns:
- the request
- See Also:
-