use of com.github.tomakehurst.wiremock.matching.BinaryEqualToPattern in project junit-servers by mjeanroy.
the class WireMockTestUtils method assertUploadRequest.
/**
* Verify that a given request has been triggered.
*
* @param endpoint Request endpoint.
* @param method Request method.
*/
static void assertUploadRequest(String endpoint, HttpMethod method, File file) {
UrlPattern urlPattern = urlEqualTo(endpoint);
RequestMethod rqMethod = new RequestMethod(method.name());
RequestPatternBuilder rq = new RequestPatternBuilder(rqMethod, urlPattern).withAllRequestBodyParts(new MultipartValuePatternBuilder().withName(file.getName()).withBody(new BinaryEqualToPattern(TestUtils.readFile(file))));
WireMock.verify(1, rq);
}
Aggregations