Package org.springframework.mock.http
Class MockHttpInputMessage
- java.lang.Object
- org.springframework.mock.http.MockHttpInputMessage
- All Implemented Interfaces:
HttpInputMessage,HttpMessage
- Direct Known Subclasses:
MockClientHttpResponse
public class MockHttpInputMessage extends Object implements HttpInputMessage
Mock implementation ofHttpInputMessage.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description MockHttpInputMessage(byte[] content)MockHttpInputMessage(InputStream body)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetBody()Return the body of the message as an input stream.HttpHeadersgetHeaders()Return the headers of this message.
Constructor Detail
MockHttpInputMessage
public MockHttpInputMessage(byte[] content)
MockHttpInputMessage
public MockHttpInputMessage(InputStream body)
Method Detail
getHeaders
public HttpHeaders getHeaders()
Description copied from interface:HttpMessageReturn the headers of this message.- Specified by:
getHeadersin interfaceHttpMessage- Returns:
- a corresponding HttpHeaders object (never
null)
getBody
public InputStream getBody() throws IOException
Description copied from interface:HttpInputMessageReturn the body of the message as an input stream.- Specified by:
getBodyin interfaceHttpInputMessage- Returns:
- the input stream body (never
null) - Throws:
IOException- in case of I/O errors