org.springframework.social.test.client
Class RequestMatchers

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

public abstract class RequestMatchers
extends java.lang.Object

Factory methods for RequestMatcher classes. Typically used to provide input for MockRestServiceServer.expect(RequestMatcher).


Method Summary
static RequestMatcher anything()
          Expects any request.
static RequestMatcher body(java.lang.String body)
          Expects the given request body content
static RequestMatcher header(java.lang.String header, java.lang.String value)
          Expects the given request header
static RequestMatcher headerContains(java.lang.String header, java.lang.String substring)
          Expects that the specified request header contains a subtring
static RequestMatcher method(HttpMethod method)
          Expects the given HttpMethod.
static RequestMatcher requestTo(java.lang.String uri)
          Expects a request to the given URI.
static RequestMatcher requestTo(java.net.URI uri)
          Expects a request to the given URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

anything

public static RequestMatcher anything()
Expects any request.

Returns:
the request matcher

method

public static RequestMatcher method(HttpMethod method)
Expects the given HttpMethod.

Parameters:
method - the HTTP method
Returns:
the request matcher

requestTo

public static RequestMatcher requestTo(java.lang.String uri)
Expects a request to the given URI.

Parameters:
uri - the request URI
Returns:
the request matcher

requestTo

public static RequestMatcher requestTo(java.net.URI uri)
Expects a request to the given URI.

Parameters:
uri - the request URI
Returns:
the request matcher

header

public static RequestMatcher header(java.lang.String header,
                                    java.lang.String value)
Expects the given request header

Parameters:
header - the header name
value - the header value
Returns:
the request matcher

headerContains

public static RequestMatcher headerContains(java.lang.String header,
                                            java.lang.String substring)
Expects that the specified request header contains a subtring

Parameters:
header - the header name
substring - the substring that must appear in the header
Returns:
the request matcher

body

public static RequestMatcher body(java.lang.String body)
Expects the given request body content

Parameters:
body - the request body
Returns:
the request matcher