As the title says I have to stub a post request with request body in the form of form data. No json, string, or xml. I am using junit and wiremock's java api.
I am doing something like the following:
wireMockServer.stubFor(post(urlEqualTo(MY_URI))
.withRequestBody(
// how do I stub a body in form data format??
).willReturn(aResponse().withStatus(200).withHeader("content-type", "application/json").withBody(expectedBody))
);
any ideas of what to put in the code instead of the comment?
Thank you!