mercredi 4 septembre 2019

Java: assert some of the values in a JSON object match a "golden list"

I was looking at JSONAssert in terms of doing a validation like this:

Service Response Example:

one = {"a":12, "b":"some string", "c":12.2334, "d":88, "e":1.23687687E7}

"Golden Data":

two = {"a":12, "d":88}

assertContainsMatches(one, two);

In other words, assert that my "golden data" from two is in one at that the values match.

Is this something I need to write myself or did I miss something with JSONAssert or another test utility?

I am trying to do this because keys like "e" are not easily checked for matching and may be skipped or checked individually with approximate matching.

Aucun commentaire:

Enregistrer un commentaire