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

Allow Java API access to the DiffView objects from HoverflyClient.getDiffs() #249

Open
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.
I currently have the problem that when the remote service returns varying, unpredictable values in responses (e.g. timestamps), Hoverfly in DIFF mode will always return a diff because only can do exact matching of actual against expected response bodies.
I would like to circumvent this problem by looking at each individual diff in my Java application and check whether it's a real difference or just because some timestamps changed.
However given the current Hoverfly-Java this is not possible since the only way to interact with the DIFF API is asserting that there are no diffs.

Describe the solution you'd like
Either:

  • Add a public API method in io.specto.hoverfly.junit.core.Hoverfly to give public access to the HoverflyClient::getDiffs method
    Or:
  • Instead of calling Assert.fail(message.toString()), where message is the combined string of all diff messages, throw a custom subclass of AssertionError that takes the individual expected/actual pairs as arguments and gives access to them to the caller that catches the excepion.

Describe alternatives you've considered
I've submitted a feature request to the spectolabs/hoverfly repo as well, as to solve the problem on the hoverfly side.

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