com.github.restdriver.serverdriver
Class Matchers

java.lang.Object
  extended by com.github.restdriver.serverdriver.Matchers

public final class Matchers
extends Object

Class to help easy & fluent use of our matchers.


Method Summary
static org.hamcrest.TypeSafeMatcher<Response> hasHeader(String name)
          Creates a new instance of HasHeader.
static org.hamcrest.TypeSafeMatcher<Response> hasHeaderWithValue(String name, org.hamcrest.Matcher<String> valueMatcher)
          Creates a new instance of HasHeaderWithValue.
static org.hamcrest.TypeSafeMatcher<Response> hasResponseBody(org.hamcrest.Matcher<String> bodyMatcher)
          Creates a new instance of HasResponseBody.
static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(int statusCode)
          Creates a new instance of HasStatusCode.
static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(org.hamcrest.Matcher<Integer> statusCodeMatcher)
          Creates a new instance of HasStatusCode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasStatusCode

public static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(int statusCode)
Creates a new instance of HasStatusCode.

Parameters:
statusCode - The status code to match
Returns:
The new matcher

hasStatusCode

public static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(org.hamcrest.Matcher<Integer> statusCodeMatcher)
Creates a new instance of HasStatusCode.

Parameters:
statusCodeMatcher - The matcher against which the status code will be evaluated
Returns:
The new matcher

hasResponseBody

public static org.hamcrest.TypeSafeMatcher<Response> hasResponseBody(org.hamcrest.Matcher<String> bodyMatcher)
Creates a new instance of HasResponseBody.

Parameters:
bodyMatcher - The matcher against which the response body will be evaluated
Returns:
The new matcher

hasHeader

public static org.hamcrest.TypeSafeMatcher<Response> hasHeader(String name)
Creates a new instance of HasHeader.

Parameters:
name - The name of the header to check for the presence of
Returns:
The new matcher

hasHeaderWithValue

public static org.hamcrest.TypeSafeMatcher<Response> hasHeaderWithValue(String name,
                                                                        org.hamcrest.Matcher<String> valueMatcher)
Creates a new instance of HasHeaderWithValue.

Parameters:
name - The name of the header to check for the presence and value of
valueMatcher - The matcher against which the header value will be evaluated
Returns:
The new matcher


Copyright © 2011. All Rights Reserved.