Package com.jcabi.http.mock
Class MkAnswerMatchers
java.lang.Object
com.jcabi.http.mock.MkAnswerMatchers
Convenient set of matchers for
MkAnswer.- Since:
- 1.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher<MkAnswer>Matches the value of the MkAnswer's body against the given matcher.static org.hamcrest.Matcher<MkAnswer>hasBodyBytes(org.hamcrest.Matcher<byte[]> matcher) Matches the value of the MkAnswer's body bytes against the given matcher.static org.hamcrest.Matcher<MkAnswer>Matches the content of the MkAnswer's header against the given matcher.
-
Method Details
-
hasBody
Matches the value of the MkAnswer's body against the given matcher.- Parameters:
matcher- The matcher to use.- Returns:
- Matcher for checking the body of MkAnswer
-
hasBodyBytes
Matches the value of the MkAnswer's body bytes against the given matcher.- Parameters:
matcher- The matcher to use- Returns:
- Matcher for checking the body of MkAnswer
-
hasHeader
public static org.hamcrest.Matcher<MkAnswer> hasHeader(String header, org.hamcrest.Matcher<Iterable<? extends String>> matcher) Matches the content of the MkAnswer's header against the given matcher. Note that for a valid match to occur, the header entry must exist and its value(s) must match the given matcher.- Parameters:
header- The header to check.matcher- The matcher to use.- Returns:
- Matcher for checking the body of MkAnswer
-