use of org.springframework.http.client.ClientHttpRequest in project spring-framework by spring-projects.
the class ContentRequestMatchers method bytes.
/**
* Compare the body of the request to the given byte array.
*/
public RequestMatcher bytes(final byte[] expectedContent) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
assertEquals("Request content", expectedContent, mockRequest.getBodyAsBytes());
}
};
}
Aggregations