Closed hydra closed 9 years ago
Here's an example of the HttpImposterVerifier that I used, for reference:
https://gist.github.com/hydra/993530d78ad0c3901082
specifically, see line 47.
To improve this requires some refactoring and to remove verification logic from the client and put it (where it belongs) in the server side. This is the current bug / improvement I am now working on.
done - will be released once #74 is also completed as these both significantly improve the verification logic
When the mock server is called with a bad request it responds with 404. Later in the test where the interactions with mock server are verified the expected request is shown via the AssertionError but it incorrectly states:
... but found no requests
This is not true as the mock server responded with 404 so there must have been a request.
This is a problem because it's then impossible to see the difference between the request that should have been made and what was made.
I'm not sure if this is by design, or if i'm not enabling a mock server feature but it's certainly not helpful when the assertion is raised.
From the logs:
the assertion is:
In this case, the currencyCode was missing from the request, but it's impossible to know that from the assertion.
I upgraded the project to the latest version of mock server.
The assertion report printed by http imposter - https://github.com/xelnaga/http-imposter - is much better in this regard because it allows you to see the difference between ALL the requests that were expected and ALL the requests that actually made, side-by-side, in the IDE using the assertion format that intellij can detect.
See also:
http://stackoverflow.com/questions/10934743/formatting-output-so-that-intellij-idea-shows-diffs-for-two-texts