org.springframework.social.test.client
Class MockClientHttpRequest

java.lang.Object
  extended by 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.


Constructor Summary
MockClientHttpRequest()
           
 
Method Summary
 ResponseActions andExpect(RequestMatcher requestMatcher)
          Allows for further expectations to be set on the request.
 void andRespond(ResponseCreator responseCreator)
          Sets the ResponseCreator for this mock.
 ClientHttpResponse execute()
           
 java.io.OutputStream getBody()
           
 java.lang.String getBodyContent()
           
 HttpHeaders getHeaders()
           
 HttpMethod getMethod()
           
 java.net.URI getURI()
           
 void setHttpMethod(HttpMethod httpMethod)
           
 void setUri(java.net.URI uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockClientHttpRequest

public MockClientHttpRequest()
Method Detail

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