public class HttpMatchers
extends java.lang.Object
Matchers that can be used in API.| Constructor and Description |
|---|
HttpMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
equalsToJson(java.lang.String expected)
Creates a matcher that matches when
Request contains body with equal to given json. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
equalsToXML(java.lang.String expected)
Creates a matcher that matches when
Request contains body with equal to given xml. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasBody()
Creates a matcher that matches when
Request contains plain text body. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasBody(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Creates a matcher that matches when
Request contains plain text body and its content
matches provided matcher. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasJsonPath(java.lang.String jsonPath)
Creates a matcher that matches when
Request contains body with given JsonPath. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasJsonPath(java.lang.String jsonPath,
org.hamcrest.Matcher<?> valueMatcher)
Creates a matcher that matches when
Request contains body with given JsonPath and its
results matches provided matcher. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasXPath(java.lang.String xpath)
Creates a matcher that matches when
Request contains body with given XPath. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasXPath(java.lang.String xpath,
org.hamcrest.Matcher<java.lang.String> valueMatcher)
Creates a matcher that matches when
Request contains body with given XPath and its
result matches provided matcher. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasXPath(java.lang.String xpath,
javax.xml.namespace.NamespaceContext namespaceContext,
org.hamcrest.Matcher<java.lang.String> valueMatcher)
Creates a matcher that matches when
Request contains body with given XPath and
namespace and its result matches provided matcher. |
static HttpOperationLoadingMatcher |
method(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Creates a matcher that matches when
Request has method that matches provided matcher. |
static HttpPathLoadingMatcher |
path(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Creates a matcher that matches when
Request has path(URI) that matches provided
matcher. |
public static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasXPath(java.lang.String xpath,
javax.xml.namespace.NamespaceContext namespaceContext,
org.hamcrest.Matcher<java.lang.String> valueMatcher)
Request contains body with given XPath and
namespace and its result matches provided matcher.xpath - XPath that should exist in Request bodynamespaceContext - namespace for XPathvalueMatcher - Matcher that matches a value of given XPathpublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasXPath(java.lang.String xpath)
Request contains body with given XPath.xpath - XPath that should exist in Request bodypublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasXPath(java.lang.String xpath,
org.hamcrest.Matcher<java.lang.String> valueMatcher)
Request contains body with given XPath and its
result matches provided matcher.xpath - XPath that should exist in Request bodyvalueMatcher - Matcher that matches a value of given XPathpublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> equalsToXML(java.lang.String expected)
Request contains body with equal to given xml.expected - expected xmlpublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasJsonPath(java.lang.String jsonPath)
Request contains body with given JsonPath.jsonPath - JsonPath that should exist in Request bodypublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasJsonPath(java.lang.String jsonPath,
org.hamcrest.Matcher<?> valueMatcher)
Request contains body with given JsonPath and its
results matches provided matcher.jsonPath - JSONPath that should exist in Request bodyvalueMatcher - Matcher that matches a value evaluated from given JSONPathpublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> equalsToJson(java.lang.String expected)
Request contains body with equal to given json.expected - expected xmlpublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasBody()
Request contains plain text body.public static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasBody(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Request contains plain text body and its content
matches provided matcher.valueMatcher - Matcher that matches a body of Requestpublic static HttpOperationLoadingMatcher method(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Request has method that matches provided matcher.valueMatcher - Matcher that matches a method of Requestpublic static HttpPathLoadingMatcher path(org.hamcrest.Matcher<java.lang.String> valueMatcher)
Request has path(URI) that matches provided
matcher.valueMatcher - Matcher that matches a path of Request