Package de.gematik.test.tiger.lib.json
Class JsonChecker
java.lang.Object
de.gematik.test.tiger.lib.json.JsonChecker
values will be first checked for containing "${json-unit.ignore}" then for equals and finally for
regex matches
JSON object attributes starting with four underscores "____" are optional and allow the oracle string to contain attributes to be checked for value ONLY if it exists in the test JSON
TODO TGR-256 check JSONObject as parameter yields unreadable output in serenity output, maybe reintroduce SerenityJSONObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertJsonArrayShouldMatchInAnyOrder(String json, String oracle) voidassertJsonArrayShouldMatchInAnyOrder(String json, String oracle, boolean checkExtraAttributes) voidassertJsonAttributeShouldMatch(org.json.JSONObject json, String claimName, String regex) voidassertJsonAttributeShouldNotMatch(org.json.JSONObject json, String claimName, String regex) voidassertJsonObjectShouldMatchOrContainInAnyOrder(String jsonStr, String oracleStr, boolean checkExtraAttributes) voidassertJsonObjectShouldMatchOrContainInAnyOrder(org.json.JSONObject json, org.json.JSONObject oracle, boolean checkExtraAttributes) voidcompareJsonStrings(Object jsonValue, Object oracleValue, boolean checkExtraAttributes) voidcompareJsonStrings(String jsonStr, String oracleStr, boolean checkExtraAttributes)
-
Field Details
-
IGNORE_JSON_VALUE
- See Also:
-
-
Constructor Details
-
JsonChecker
public JsonChecker()
-
-
Method Details
-
compareJsonStrings
-
compareJsonStrings
-
assertJsonArrayShouldMatchInAnyOrder
-
assertJsonArrayShouldMatchInAnyOrder
-
assertJsonObjectShouldMatchOrContainInAnyOrder
-
assertJsonObjectShouldMatchOrContainInAnyOrder
public void assertJsonObjectShouldMatchOrContainInAnyOrder(org.json.JSONObject json, org.json.JSONObject oracle, boolean checkExtraAttributes) -
assertJsonAttributeShouldMatch
-
assertJsonAttributeShouldNotMatch
-