Skip to content

Add possibility to control response body diff matching behaviour #954

@zudljk

Description

@zudljk

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions