Open DeuceTheCoder opened 5 years ago
I can't see anything wrong with your test. Check the logs, it should show you what was actually received (you may need to enable DEBUG level logs).
My assumption is the content type is not being sent correctly. The only difference I can see from a SO search is forcing the generic type HttpEntity<String> entity = new HttpEntity<>(json, headers);
but I don't see how that could make it behave incorrectly.
I gave that a try, and it still fails (no big surprise there). I've fallen back to using a Jackson ObjectMapper to write the string into a JsonNode object, and posting the result.
I'm writing a test for a post request, and I'm trying to create matchers for the post request body. My code is below:
Upon running this test, I receive the following error:
How do I make the mock server convert the JSON string in the request to a map in order to correctly match?