Interface MockServerHttpRequest.BaseBuilder<B extends MockServerHttpRequest.BaseBuilder<B>>
- Type Parameters:
B- the builder sub-class
- 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Baccept(MediaType... acceptableMediaTypes)Set the list of acceptable media types, as specified by theAcceptheader.BacceptCharset(Charset... acceptableCharsets)Set the list of acceptable charsets, as specified by theAccept-Charsetheader.BacceptLanguageAsLocales(Locale... acceptableLocales)Set the list of acceptable locales, as specified by theAccept-Languagesheader.MockServerHttpRequestbuild()Builds the request with no body.BcontextPath(String contextPath)Set the contextPath to return.Bcookie(HttpCookie... cookie)Add one or more cookies.Bcookies(MultiValueMap<String,HttpCookie> cookies)Add the given cookies.Bheader(String headerName, String... headerValues)Add the given, single header value under the given name.Bheaders(MultiValueMap<String,String> headers)Add the given header values.BifModifiedSince(long ifModifiedSince)Set the value of theIf-Modified-Sinceheader.BifNoneMatch(String... ifNoneMatches)Set the values of theIf-None-Matchheader.BifUnmodifiedSince(long ifUnmodifiedSince)Set the (new) value of theIf-Unmodified-Sinceheader.BlocalAddress(InetSocketAddress localAddress)Set the local address to return.BqueryParam(String name, Object... values)Append the given query parameter to the existing query parameters.BqueryParams(MultiValueMap<String,String> params)Add the given query parameters and values.Brange(HttpRange... ranges)Set the (new) value of the Range header.BremoteAddress(InetSocketAddress remoteAddress)Set the remote address to return.voidsslInfo(SslInfo sslInfo)Set SSL session information and certificates.
Method Detail
contextPath
B contextPath(String contextPath)
Set the contextPath to return.
queryParam
B queryParam(String name, Object... values)
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.?fooinstead 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
B queryParams(MultiValueMap<String,String> params)
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
B remoteAddress(InetSocketAddress remoteAddress)
Set the remote address to return.
localAddress
B localAddress(InetSocketAddress localAddress)
Set the local address to return.- Since:
- 5.2.3
cookie
B cookie(HttpCookie... cookie)
Add one or more cookies.
cookies
B cookies(MultiValueMap<String,HttpCookie> cookies)
Add the given cookies.- Parameters:
cookies- the cookies.
header
B header(String headerName, String... headerValues)
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
B headers(MultiValueMap<String,String> headers)
Add the given header values.- Parameters:
headers- the header values
accept
B accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as specified by theAcceptheader.- Parameters:
acceptableMediaTypes- the acceptable media types
acceptCharset
B acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified by theAccept-Charsetheader.- Parameters:
acceptableCharsets- the acceptable charsets
acceptLanguageAsLocales
B acceptLanguageAsLocales(Locale... acceptableLocales)
Set the list of acceptable locales, as specified by theAccept-Languagesheader.- Parameters:
acceptableLocales- the acceptable locales
ifModifiedSince
B ifModifiedSince(long ifModifiedSince)
Set the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- Parameters:
ifModifiedSince- the new value of the header
ifUnmodifiedSince
B ifUnmodifiedSince(long ifUnmodifiedSince)
Set the (new) value of theIf-Unmodified-Sinceheader.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
B ifNoneMatch(String... ifNoneMatches)
Set the values of theIf-None-Matchheader.- Parameters:
ifNoneMatches- the new value of the header
range
B range(HttpRange... ranges)
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:
MockServerHttpRequest.BodyBuilder.body(Publisher),MockServerHttpRequest.BodyBuilder.body(String)