Package de.gematik.test.tiger.lib.json
Class JsonChecker
- java.lang.Object
-
- de.gematik.test.tiger.lib.json.JsonChecker
-
public class JsonChecker extends Object
values will be first checked for containing "${json-unit.ignore}" then for equals and finally for regex matchesJSON 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: check JSONObject as parameter yields unreadable output in serenity output, maybe reintroduce SerenityJSONObject
-
-
Field Summary
Fields Modifier and Type Field Description static StringIGNORE_JSON_VALUE
-
Constructor Summary
Constructors Constructor Description JsonChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertJsonArrayShouldMatchInAnyOrder(String json, String oracle)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)
-
-
-
Field Detail
-
IGNORE_JSON_VALUE
public static final String IGNORE_JSON_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
assertJsonArrayShouldMatchInAnyOrder
public void assertJsonArrayShouldMatchInAnyOrder(String json, String oracle)
-
assertJsonObjectShouldMatchOrContainInAnyOrder
public void assertJsonObjectShouldMatchOrContainInAnyOrder(String jsonStr, String oracleStr, boolean checkExtraAttributes)
-
assertJsonAttributeShouldMatch
public void assertJsonAttributeShouldMatch(org.json.JSONObject json, String claimName, String regex)
-
-