How to compare two JSON objects in Java tests and when the order of values is not important
Compare two big JSON objects in Java tests easily
3 min readMay 2, 2022
When I am writing tests to confirm the JSON structure generated in the API with the expected structure, I almost always prefer to use the JSON path for this job, but In some scenarios, you can’t use the JSON path and write one assertion for each field in the expected JSON result, for example when your API produces a very large JSON response. In these cases, maybe it is a good idea to have the…