org.springframework.mock.http.client

Class MockClientHttpResponse

    • Constructor Detail

      • MockClientHttpResponse

        public MockClientHttpResponse(byte[] body,
                                      HttpStatus statusCode)
        Constructor with response body as a byte array.
      • MockClientHttpResponse

        public MockClientHttpResponse(java.io.InputStream body,
                                      HttpStatus statusCode)
        Constructor with response body as InputStream.
    • Method Detail

      • getStatusText

        public java.lang.String getStatusText()
                                       throws java.io.IOException
        Description copied from interface: ClientHttpResponse
        Return the HTTP status text of the response.
        Specified by:
        getStatusText in interface ClientHttpResponse
        Returns:
        the HTTP status text
        Throws:
        java.io.IOException - in case of I/O errors
      • close

        public void close()
        Description copied from interface: ClientHttpResponse
        Close this response, freeing any resources created.
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ClientHttpResponse