* Compare the body of the request to the given byte array.
*/
public RequestMatcher bytes(final byte[] expectedContent) {
return new RequestMatcher() {
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
byte[] content = mockRequest.getBodyAsBytes();
MatcherAssert.assertThat("Request content", content, Matchers.equalTo(expectedContent));
}
};
}