Spring Social

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).

Author:
Arjen Poutsma, Craig Walls

Method Summary
static ResponseCreator withResponse(org.springframework.core.io.Resource responseBody, org.springframework.http.HttpHeaders headers)
          Response with a given response body and headers.
static ResponseCreator withResponse(org.springframework.core.io.Resource responseBodyResource, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus statusCode, java.lang.String statusText)
          Respond with a given response body (from a Resource) and headers.
static ResponseCreator withResponse(java.lang.String responseBody, org.springframework.http.HttpHeaders headers)
          Response with a given response body and headers.
static ResponseCreator withResponse(java.lang.String responseBody, org.springframework.http.HttpHeaders headers, org.springframework.http.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,
                                           org.springframework.http.HttpHeaders headers,
                                           org.springframework.http.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,
                                           org.springframework.http.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(org.springframework.core.io.Resource responseBodyResource,
                                           org.springframework.http.HttpHeaders headers,
                                           org.springframework.http.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(org.springframework.core.io.Resource responseBody,
                                           org.springframework.http.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

Spring Social