org.springframework.social.test.client
Class MockClientHttpRequest
java.lang.Object
org.springframework.social.test.client.MockClientHttpRequest
- All Implemented Interfaces:
- ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest, ResponseActions
public class MockClientHttpRequest
- extends java.lang.Object
- implements ClientHttpRequest, ResponseActions
Mock implementation of ClientHttpRequest
. Implements ResponseActions
to form a fluent API.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockClientHttpRequest
public MockClientHttpRequest()
setUri
public void setUri(java.net.URI uri)
setHttpMethod
public void setHttpMethod(HttpMethod httpMethod)
andExpect
public ResponseActions andExpect(RequestMatcher requestMatcher)
- Description copied from interface:
ResponseActions
- Allows for further expectations to be set on the request.
- Specified by:
andExpect
in interface ResponseActions
- Returns:
- the request expectations
andRespond
public void andRespond(ResponseCreator responseCreator)
- Description copied from interface:
ResponseActions
- Sets the
ResponseCreator
for this mock.
- Specified by:
andRespond
in interface ResponseActions
- Parameters:
responseCreator
- the response creator
getMethod
public HttpMethod getMethod()
- Specified by:
getMethod
in interface HttpRequest
getURI
public java.net.URI getURI()
- Specified by:
getURI
in interface HttpRequest
getHeaders
public HttpHeaders getHeaders()
- Specified by:
getHeaders
in interface HttpMessage
getBody
public java.io.OutputStream getBody()
throws java.io.IOException
- Specified by:
getBody
in interface HttpOutputMessage
- Throws:
java.io.IOException
getBodyContent
public java.lang.String getBodyContent()
throws java.io.IOException
- Throws:
java.io.IOException
execute
public ClientHttpResponse execute()
throws java.io.IOException
- Specified by:
execute
in interface ClientHttpRequest
- Throws:
java.io.IOException