Class JsonChecker

java.lang.Object
de.gematik.test.tiger.lib.json.JsonChecker

@Slf4j public class JsonChecker extends Object
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

  • Field Details

  • Constructor Details

    • JsonChecker

      public JsonChecker()
  • Method Details

    • compareJsonStrings

      public void compareJsonStrings(String jsonStr, String oracleStr, boolean checkExtraAttributes)
    • compareJsonStrings

      public void compareJsonStrings(Object jsonValue, Object oracleValue, boolean checkExtraAttributes)
    • assertJsonArrayShouldMatchInAnyOrder

      public void assertJsonArrayShouldMatchInAnyOrder(String json, String oracle)
    • assertJsonArrayShouldMatchInAnyOrder

      public void assertJsonArrayShouldMatchInAnyOrder(String json, String oracle, boolean checkExtraAttributes)
    • assertJsonObjectShouldMatchOrContainInAnyOrder

      public void assertJsonObjectShouldMatchOrContainInAnyOrder(String jsonStr, String oracleStr, boolean checkExtraAttributes)
    • assertJsonObjectShouldMatchOrContainInAnyOrder

      public void assertJsonObjectShouldMatchOrContainInAnyOrder(org.json.JSONObject json, org.json.JSONObject oracle, boolean checkExtraAttributes)
    • assertJsonAttributeShouldMatch

      public void assertJsonAttributeShouldMatch(org.json.JSONObject json, String claimName, String regex)
    • assertJsonAttributeShouldNotMatch

      public void assertJsonAttributeShouldNotMatch(org.json.JSONObject json, String claimName, String regex)