public class HeaderRequestMatcher extends RequestMatcher<List<String>>
RequestMatcher
used for matching a request header.pred
Modifier | Constructor and Description |
---|---|
protected |
HeaderRequestMatcher(org.hamcrest.Matcher<? super List<String>> pred,
String headerName)
Protected constructor useful only when subtyping.
|
Modifier and Type | Method and Description |
---|---|
protected String |
provideDescription()
Provides a description of this matcher in form of a string consisting of "noun verb", where
noun describes the value retrieved using
RequestMatcher.retrieveValue(net.jadler.Request) and verb is usually a correct
form of to be. |
static HeaderRequestMatcher |
requestHeader(String headerName,
org.hamcrest.Matcher<? super List<String>> pred)
Factory method to create new instance of this matcher.
|
protected List<String> |
retrieveValue(Request req)
Retrieves a header (defined in
HeaderRequestMatcher(org.hamcrest.Matcher, java.lang.String) )
of the given request. |
describeMismatch, describeTo, matches
protected HeaderRequestMatcher(org.hamcrest.Matcher<? super List<String>> pred, String headerName)
requestHeader(java.lang.String, org.hamcrest.Matcher)
instead.pred
- a predicate to be applied on the given request headerheaderName
- name of a request header (case insensitive)protected List<String> retrieveValue(Request req)
HeaderRequestMatcher(org.hamcrest.Matcher, java.lang.String)
)
of the given request.retrieveValue
in class RequestMatcher<List<String>>
req
- request to retrieve the header fromnull
if there is no such a header in the requestprotected String provideDescription()
Provides a description of this matcher in form of a string consisting of "noun verb", where
noun describes the value retrieved using RequestMatcher.retrieveValue(net.jadler.Request)
and verb is usually a correct
form of to be.
If the RequestMatcher.retrieveValue(net.jadler.Request)
provided a request method, this method would return
method is string for example.
provideDescription
in class RequestMatcher<List<String>>
public static HeaderRequestMatcher requestHeader(String headerName, org.hamcrest.Matcher<? super List<String>> pred)
headerName
- name of a request headerpred
- a predicate to be applied on the request headerCopyright © 2016. All Rights Reserved.