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

Soft assertion #5

Closed
onlybiju opened this issue Feb 3, 2020 · 3 comments · Fixed by #59
Closed

Soft assertion #5

onlybiju opened this issue Feb 3, 2020 · 3 comments · Fixed by #59
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@onlybiju
Copy link

onlybiju commented Feb 3, 2020

Hello Team,
Thanks a lot for excellent json comparison tool...But can I suggest for an enhancement?

Would you please be able to implement soft assertion while doing JSON comparison?
For example, we are comparing 2 JSON files JSON A and JSON B. Both are having 10 fields. suppose while comparing something doesn't matches at 2nd field, the code stops over here and it doesn't compares rest of the 8 fields. Is there is any way we can compare rest of the 8 fields?
Please let me know if this can be done as enhancement?

Thank you!
Biju

@fslev
Copy link
Owner

fslev commented Feb 4, 2020

I believe you are referring to showing all differences between the two json objects and not stop at the first one encountered.
Sure, this is a good idea.
Implementing this isn't quite a walk in the park, since there are a lot of scenarios that need to be covered.
I believe that something similar to XML Unit, should be in place:
https://www.baeldung.com/xmlunit2#2-detailed-difference-example

You can also submit a pull request with the new feature.

@fslev fslev added the help wanted Extra attention is needed label Feb 4, 2020
@fslev fslev pinned this issue Feb 4, 2020
@fslev fslev unpinned this issue Feb 4, 2020
@fslev fslev added the enhancement New feature or request label Feb 4, 2020
@fslev fslev pinned this issue Feb 4, 2020
@onlybiju
Copy link
Author

onlybiju commented Feb 7, 2020

Thank you! Will try to implement

@fslevoaca-ionos
Copy link
Collaborator

fslevoaca-ionos commented Oct 4, 2022

Implemented soft assertion support by checking all JSON diffs. Differences are exposed inside the AssertionError message.
Released new major version inside Maven central repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants