public class RawBodyRequestMatcher extends RequestMatcher<byte[]>
RequestMatcher
used for matching the request body as an array of bytes.pred
Modifier | Constructor and Description |
---|---|
protected |
RawBodyRequestMatcher(org.hamcrest.Matcher<byte[]> pred)
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 RawBodyRequestMatcher |
requestRawBody(org.hamcrest.Matcher<byte[]> pred)
Factory method to create new instance of this matcher.
|
protected byte[] |
retrieveValue(Request req)
Retrieves the body of the given request
|
describeMismatch, describeTo, matches
protected RawBodyRequestMatcher(org.hamcrest.Matcher<byte[]> pred)
requestRawBody(org.hamcrest.Matcher)
instead.pred
- a predicate to be applied on the request bodyprotected byte[] retrieveValue(Request req) throws Exception
retrieveValue
in class RequestMatcher<byte[]>
req
- request to retrieve the body fromnull
)Exception
- when something goes wrong. This exception will be handler correctly by Jadler.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.
If the RequestMatcher.retrieveValue(net.jadler.Request)
provided a request method, this method would return
method is string for example.
provideDescription
in class RequestMatcher<byte[]>
public static RawBodyRequestMatcher requestRawBody(org.hamcrest.Matcher<byte[]> pred)
pred
- a predicate to be applied on the request bodyCopyright © 2016. All Rights Reserved.