public final class Matchers extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.TypeSafeMatcher<Response> |
hasHeader(Header header)
Creates a new instance of HasHeader.
|
static org.hamcrest.TypeSafeMatcher<Response> |
hasHeader(String header)
Creates a new instance of HasHeader.
|
static org.hamcrest.TypeSafeMatcher<Response> |
hasHeader(String name,
org.hamcrest.Matcher<String> valueMatcher)
Synonym for
HasHeaderWithValue, using matcher for the value. |
static org.hamcrest.TypeSafeMatcher<Response> |
hasHeader(String name,
String value)
Synonym for
HasHeaderWithValue, using exact match for the value. |
static org.hamcrest.TypeSafeMatcher<Response> |
hasHeaderWithValue(String name,
org.hamcrest.Matcher<String> valueMatcher)
Creates a new instance of HasHeaderWithValue.
|
static <T> org.hamcrest.TypeSafeMatcher<com.fasterxml.jackson.databind.JsonNode> |
hasJsonPath(String jsonPath)
Checks whether the given JSON object matches the JSONpath.
|
static <T> org.hamcrest.TypeSafeMatcher<com.fasterxml.jackson.databind.JsonNode> |
hasJsonPath(String jsonPath,
org.hamcrest.Matcher<T> matcher)
Checks whether the given JSON object matches the JSONpath.
|
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.
|
static org.hamcrest.TypeSafeMatcher<Header> |
isRfc1123Compliant()
Checks whether a header's value is a valid date according to RFC1123.
|
static org.hamcrest.TypeSafeMatcher<Header> |
isValidDateHeader()
Checks whether a header's value is a valid date according to RFC1123.
|
public static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(int statusCode)
statusCode - The status code to matchpublic static org.hamcrest.TypeSafeMatcher<Response> hasStatusCode(org.hamcrest.Matcher<Integer> statusCodeMatcher)
statusCodeMatcher - The matcher against which the status code will be evaluatedpublic static org.hamcrest.TypeSafeMatcher<Response> hasResponseBody(org.hamcrest.Matcher<String> bodyMatcher)
bodyMatcher - The matcher against which the response body will be evaluatedpublic static org.hamcrest.TypeSafeMatcher<Response> hasHeader(String header)
header - The name of the header to check for the presence of - or name and value separated by ":"public static org.hamcrest.TypeSafeMatcher<Response> hasHeader(Header header)
header - The header to check for the presence ofpublic static org.hamcrest.TypeSafeMatcher<Response> hasHeader(String name, String value)
HasHeaderWithValue, using exact match for the value.name - The name of the header to check for the presence ofvalue - The the header value to checkpublic static org.hamcrest.TypeSafeMatcher<Response> hasHeader(String name, org.hamcrest.Matcher<String> valueMatcher)
HasHeaderWithValue, using matcher for the value.name - The name of the header to check for the presence and value ofvalueMatcher - The matcher against which the header value will be evaluatedpublic static org.hamcrest.TypeSafeMatcher<Response> hasHeaderWithValue(String name, org.hamcrest.Matcher<String> valueMatcher)
name - The name of the header to check for the presence and value ofvalueMatcher - The matcher against which the header value will be evaluatedpublic static org.hamcrest.TypeSafeMatcher<Header> isValidDateHeader()
public static org.hamcrest.TypeSafeMatcher<Header> isRfc1123Compliant()
public static <T> org.hamcrest.TypeSafeMatcher<com.fasterxml.jackson.databind.JsonNode> hasJsonPath(String jsonPath)
T - The type of the matcher.jsonPath - The JSONpath to match.public static <T> org.hamcrest.TypeSafeMatcher<com.fasterxml.jackson.databind.JsonNode> hasJsonPath(String jsonPath, org.hamcrest.Matcher<T> matcher)
T - The type of the matcher.jsonPath - The JSONpath to match.matcher - The matcher to apply to the result of the JSONpath.Copyright © 2013. All Rights Reserved.