org.springframework.mock.http.client

Class MockClientHttpRequest

    • Constructor Detail

      • MockClientHttpRequest

        public MockClientHttpRequest()
        Default constructor.
      • MockClientHttpRequest

        public MockClientHttpRequest(HttpMethod httpMethod,
                                     java.net.URI uri)
        Create an instance with the given HttpMethod and URI.
    • Method Detail

      • setMethod

        public void setMethod(HttpMethod httpMethod)
      • getMethodValue

        public java.lang.String getMethodValue()
        Description copied from interface: HttpRequest
        Return the HTTP method of the request as a String value.
        Specified by:
        getMethodValue in interface HttpRequest
        Returns:
        the HTTP method as a plain String
        See Also:
        HttpRequest.getMethod()
      • setURI

        public void setURI(java.net.URI uri)
      • getURI

        public java.net.URI getURI()
        Description copied from interface: HttpRequest
        Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).
        Specified by:
        getURI in interface HttpRequest
        Returns:
        the URI of the request (never null)
      • isExecuted

        public boolean isExecuted()
      • executeInternal

        protected ClientHttpResponse executeInternal()
                                              throws java.io.IOException
        The default implementation returns the configured response.

        Override this method to execute the request and provide a response, potentially different than the configured response.

        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object