Class JsonTestUtils

java.lang.Object
org.keycloak.tests.utils.JsonTestUtils

public class JsonTestUtils extends Object
Utility for comparing JSON objects
Author:
Marek Posolda
  • Constructor Details

    • JsonTestUtils

      public JsonTestUtils()
  • Method Details

    • assertJsonEquals

      public static <T> void assertJsonEquals(T o1, T o2)
      Type Parameters:
      T -
      Parameters:
      o1 -
      o2 -
    • assertJsonEquals

      public static void assertJsonEquals(String o1, Object o2)
      Compare Object in the JSON node with the "unparsed" String version of that object
      Parameters:
      o1 - String with JSON. Assumption is, that it can be "read" to the same object class of object o1
      o2 -
    • assertJsonEquals

      public static void assertJsonEquals(String o1, String o2, Class<?> clazz)
      Compares if 2 strings logically refers same JSON.
      Parameters:
      o1 -
      o2 -
      clazz - Java class, which strings o1 and o2 can be read into