Package org.keycloak.tests.utils
Class JsonTestUtils
java.lang.Object
org.keycloak.tests.utils.JsonTestUtils
Utility for comparing JSON objects
- Author:
- Marek Posolda
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertJsonEquals(String o1, Object o2) Compare Object in the JSON node with the "unparsed" String version of that objectstatic voidassertJsonEquals(String o1, String o2, Class<?> clazz) Compares if 2 strings logically refers same JSON.static <T> voidassertJsonEquals(T o1, T o2)
-
Constructor Details
-
JsonTestUtils
public JsonTestUtils()
-
-
Method Details
-
assertJsonEquals
public static <T> void assertJsonEquals(T o1, T o2) - Type Parameters:
T-- Parameters:
o1-o2-
-
assertJsonEquals
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 o1o2-
-
assertJsonEquals
Compares if 2 strings logically refers same JSON.- Parameters:
o1-o2-clazz- Java class, which strings o1 and o2 can be read into
-