org.springframework.social.test.client
Class ResponseCreators

java.lang.Object
  extended by org.springframework.social.test.client.ResponseCreators

public abstract class ResponseCreators
extends java.lang.Object

Factory methods for ResponseCreator classes. Typically used to provide input for ResponseActions.andRespond(ResponseCreator).


Method Summary
static ResponseCreator withResponse(Resource responseBody, HttpHeaders headers)
          Response with a given response body and headers.
static ResponseCreator withResponse(Resource responseBodyResource, HttpHeaders headers, HttpStatus statusCode, java.lang.String statusText)
          Respond with a given response body (from a Resource) and headers.
static ResponseCreator withResponse(java.lang.String responseBody, HttpHeaders headers)
          Response with a given response body and headers.
static ResponseCreator withResponse(java.lang.String responseBody, HttpHeaders headers, HttpStatus statusCode, java.lang.String statusText)
          Respond with a given response body, headers, status code, and status text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withResponse

public static ResponseCreator withResponse(java.lang.String responseBody,
                                           HttpHeaders headers,
                                           HttpStatus statusCode,
                                           java.lang.String statusText)
Respond with a given response body, headers, status code, and status text.

Parameters:
responseBody - the body of the response
headers - the response headers
statusCode - the response status code
statusText - the response status text
Returns:
a ResponseCreator

withResponse

public static ResponseCreator withResponse(java.lang.String responseBody,
                                           HttpHeaders headers)
Response with a given response body and headers. The response status code is HTTP 200 (OK).

Parameters:
responseBody - the body of the response
headers - the response headers
Returns:
a ResponseCreator

withResponse

public static ResponseCreator withResponse(Resource responseBodyResource,
                                           HttpHeaders headers,
                                           HttpStatus statusCode,
                                           java.lang.String statusText)
Respond with a given response body (from a Resource) and headers. The response status code is HTTP 200 (OK).

Parameters:
responseBodyResource - a Resource containing the body of the response
headers - the response headers
statusCode - the response status code
statusText - the response status text
Returns:
a ResponseCreator

withResponse

public static ResponseCreator withResponse(Resource responseBody,
                                           HttpHeaders headers)
Response with a given response body and headers. The response status code is HTTP 200 (OK).

Parameters:
responseBody - the body of the response
headers - the response headers
Returns:
a ResponseCreator