public class GenericMatchers
extends java.lang.Object
Request
.Constructor and Description |
---|
GenericMatchers() |
Modifier and Type | Method and Description |
---|---|
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
absentArgumentEntry(java.lang.String meta)
Creates a matcher that matches when
Request not contains argument key with given name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
absentCookie(java.lang.String meta)
Creates a matcher that matches when
Request not contains metadata key with given name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
absentHeader(java.lang.String meta)
Creates a matcher that matches when
Request not contains metadata key with given name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
customMatcher(com.ca.codesv.sdk.function.Predicate<com.ca.codesv.sdk.Request> requestPredicate)
Creates a matcher that matches when the
Request causes the provided Predicate
to return true. |
static RequestAccessor |
getRequestAccessor() |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasArgument(java.lang.String argument)
Creates a matcher that matches when
Request contains argument key with given name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasArgumentEntry(java.lang.String argument,
org.hamcrest.Matcher<?> matcher)
Creates a matcher that matches when
Request contains argument key with given name and
evaluates given Matcher against values from this argument. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasAttribute(java.lang.String attribute)
Creates a matcher that matches when
Request contains attribute key with given name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasAttributeEntry(java.lang.String attribute,
org.hamcrest.Matcher<?> matcher)
Creates a matcher that matches when
Request contains attribute key with given name and
evaluates given Matcher against values from this attribute. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasMeta(org.hamcrest.Matcher<java.lang.String> matcher)
Creates a matcher that matches when
Request contains meta attribute key that matches
against given matcher. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasMeta(java.lang.String meta)
Creates a matcher that matches when
Request contains meta attribute key with given
name. |
static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> |
hasMetaEntry(java.lang.String meta,
org.hamcrest.Matcher<?> matcher)
Creates a matcher that matches when
Request contains metadata key with given name and
evaluates given Matcher against values from this metadata. |
static org.hamcrest.Matcher<java.lang.String> |
matchesPattern(java.util.regex.Pattern pattern)
Creates a matcher of
String that matches when the examined string exactly
matches the given Pattern . |
static org.hamcrest.Matcher<java.lang.String> |
matchesPattern(java.lang.String regex)
Creates a matcher of
String that matches when the examined string exactly
matches the given regular expression, treated as a Pattern . |
static org.hamcrest.Matcher<java.lang.String> |
matchesTemplate(java.lang.String template)
Creates a matcher that matches given template with placeholders against incoming String text.
|
static void |
setRequestAccessor(RequestAccessor requestAccessor)
Sets
RequestAccessor to the requestAccessor. |
public static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasMeta(java.lang.String meta)
Request
contains meta attribute key with given
name.meta
- name of the meta attributepublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasMeta(org.hamcrest.Matcher<java.lang.String> matcher)
Request
contains meta attribute key that matches
against given matcher.matcher
- Matcher
that should be used on metadata of Request
public static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasMetaEntry(java.lang.String meta, org.hamcrest.Matcher<?> matcher)
Request
contains metadata key with given name and
evaluates given Matcher
against values from this metadata.meta
- name of the metadatamatcher
- Matcher
that should be matched against values of key from metadatapublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> absentHeader(java.lang.String meta)
Request
not contains metadata key with given name.meta
- name of the metadatapublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> absentCookie(java.lang.String meta)
Request
not contains metadata key with given name.meta
- name of the metadatapublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasArgument(java.lang.String argument)
Request
contains argument key with given name.argument
- Matcher
that should be used on arguments of Request
public static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasArgumentEntry(java.lang.String argument, org.hamcrest.Matcher<?> matcher)
Request
contains argument key with given name and
evaluates given Matcher against values from this argument.argument
- name of the argumentmatcher
- Matcher
that should be matched against values of key from argumentspublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> absentArgumentEntry(java.lang.String meta)
Request
not contains argument key with given name.meta
- name of the metadatapublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasAttribute(java.lang.String attribute)
Request
contains attribute key with given name.attribute
- name of the attributepublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> hasAttributeEntry(java.lang.String attribute, org.hamcrest.Matcher<?> matcher)
Request
contains attribute key with given name and
evaluates given Matcher against values from this attribute.attribute
- name of the attributematcher
- Matcher
that should be matched against values of key from attributespublic static org.hamcrest.Matcher<com.ca.codesv.sdk.Request> customMatcher(com.ca.codesv.sdk.function.Predicate<com.ca.codesv.sdk.Request> requestPredicate)
Request
causes the provided Predicate
to return true.requestPredicate
- the Predicate
to use to check the Request
public static org.hamcrest.Matcher<java.lang.String> matchesPattern(java.util.regex.Pattern pattern)
String
that matches when the examined string exactly
matches the given Pattern
.pattern
- Pattern
public static org.hamcrest.Matcher<java.lang.String> matchesPattern(java.lang.String regex)
String
that matches when the examined string exactly
matches the given regular expression, treated as a Pattern
.regex
- string representing Pattern
public static org.hamcrest.Matcher<java.lang.String> matchesTemplate(java.lang.String template)
template
- template for matchingpublic static RequestAccessor getRequestAccessor()
public static void setRequestAccessor(RequestAccessor requestAccessor)
RequestAccessor
to the requestAccessor.requestAccessor
- requestAccessor