Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to control response body diff matching behaviour #954

Open
zudljk opened this issue Dec 4, 2020 · 0 comments
Open

Add possibility to control response body diff matching behaviour #954

zudljk opened this issue Dec 4, 2020 · 0 comments

Comments

@zudljk
Copy link

zudljk commented Dec 4, 2020

Is your feature request related to a problem? Please describe.
When the real webservice returns a body that has unpredictable values, like e.g. timestamps, the DIFF mode will always report a diff, since it does an exact matching between the expected response (in the simulation file) and the actual (real) response.

Describe the solution you'd like
It should be possible to somehow control how Hoverfly matches actual responses against expected ones, e.g. specifying a body matching method in the response part of the simulation.

Describe alternatives you've considered
A workaround for the missing functionality would be to extract the diffs, and re-compare expected and actual bodies with an external program. However, since Hoverfly-Java doesn't support doing anything with the diffs (the public Java API only supports asserting that there are no diffs), this would mean to parse the exception message coming out of assertThatNoDiffIsReported.
Another workaround would be to ignore the DIFF mode altogether and run the tests again in CAPTURE mode, creating another simulation file, then compare the 2 simulation files externally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants