org.springframework.mock.http.server.reactive

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 and Description
      B accept(MediaType... acceptableMediaTypes)
      Set the list of acceptable media types, as specified by the Accept header.
      B acceptCharset(java.nio.charset.Charset... acceptableCharsets)
      Set the list of acceptable charsets, as specified by the Accept-Charset header.
      B acceptLanguageAsLocales(java.util.Locale... acceptableLocales)
      Set the list of acceptable locales, as specified by the Accept-Languages header.
      MockServerHttpRequest build()
      Builds the request with no body.
      B contextPath(java.lang.String contextPath)
      Set the contextPath to return.
      B cookie(HttpCookie... cookie)
      Add one or more cookies.
      B cookies(MultiValueMap<java.lang.String,HttpCookie> cookies)
      Add the given cookies.
      B header(java.lang.String headerName, java.lang.String... headerValues)
      Add the given, single header value under the given name.
      B headers(MultiValueMap<java.lang.String,java.lang.String> headers)
      Add the given header values.
      B ifModifiedSince(long ifModifiedSince)
      Set the value of the If-Modified-Since header.
      B ifNoneMatch(java.lang.String... ifNoneMatches)
      Set the values of the If-None-Match header.
      B ifUnmodifiedSince(long ifUnmodifiedSince)
      Set the (new) value of the If-Unmodified-Since header.
      B queryParam(java.lang.String name, java.lang.Object... values)
      Append the given query parameter to the existing query parameters.
      B queryParams(MultiValueMap<java.lang.String,java.lang.String> params)
      Add the given query parameters and values.
      B range(HttpRange... ranges)
      Set the (new) value of the Range header.
      B remoteAddress(java.net.InetSocketAddress remoteAddress)
      Set the remote address to return.
      void sslInfo(SslInfo sslInfo)
      Set SSL session information and certificates.
    • Method Detail

      • contextPath

        B contextPath(java.lang.String contextPath)
        Set the contextPath to return.
      • queryParam

        B queryParam(java.lang.String name,
                     java.lang.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. ?foo instead of ?foo=bar).

        The provided query name and values will be encoded.

        Parameters:
        name - the query parameter name
        values - the query parameter values
        Returns:
        this UriComponentsBuilder
      • queryParams

        B queryParams(MultiValueMap<java.lang.String,java.lang.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(java.net.InetSocketAddress remoteAddress)
        Set the remote address to return.
      • sslInfo

        void sslInfo(SslInfo sslInfo)
        Set SSL session information and certificates.
      • cookie

        B cookie(HttpCookie... cookie)
        Add one or more cookies.
      • cookies

        B cookies(MultiValueMap<java.lang.String,HttpCookie> cookies)
        Add the given cookies.
        Parameters:
        cookies - the cookies.
      • header

        B header(java.lang.String headerName,
                 java.lang.String... headerValues)
        Add the given, single header value under the given name.
        Parameters:
        headerName - the header name
        headerValues - the header value(s)
        See Also:
        HttpHeaders.add(String, String)
      • headers

        B headers(MultiValueMap<java.lang.String,java.lang.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 the Accept header.
        Parameters:
        acceptableMediaTypes - the acceptable media types
      • acceptCharset

        B acceptCharset(java.nio.charset.Charset... acceptableCharsets)
        Set the list of acceptable charsets, as specified by the Accept-Charset header.
        Parameters:
        acceptableCharsets - the acceptable charsets
      • acceptLanguageAsLocales

        B acceptLanguageAsLocales(java.util.Locale... acceptableLocales)
        Set the list of acceptable locales, as specified by the Accept-Languages header.
        Parameters:
        acceptableLocales - the acceptable locales
      • ifModifiedSince

        B ifModifiedSince(long ifModifiedSince)
        Set the value of the If-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

        B ifUnmodifiedSince(long ifUnmodifiedSince)
        Set the (new) value of the If-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

        B ifNoneMatch(java.lang.String... ifNoneMatches)
        Set the values of the If-None-Match header.
        Parameters:
        ifNoneMatches - the new value of the header