public class JsonExpectationsHelper
extends java.lang.Object
Use of this class requires the JSONassert library.
| Constructor and Description |
|---|
JsonExpectationsHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertJsonEqual(java.lang.String expected,
java.lang.String actual)
Parse the expected and actual strings as JSON and assert the two
are "similar" - i.e.
|
void |
assertJsonEqual(java.lang.String expected,
java.lang.String actual,
boolean strict)
Parse the expected and actual strings as JSON and assert the two
are "similar" - i.e.
|
void |
assertJsonNotEqual(java.lang.String expected,
java.lang.String actual)
Parse the expected and actual strings as JSON and assert the two
are "not similar" - i.e.
|
void |
assertJsonNotEqual(java.lang.String expected,
java.lang.String actual,
boolean strict)
Parse the expected and actual strings as JSON and assert the two
are "not similar" - i.e.
|
public void assertJsonEqual(java.lang.String expected,
java.lang.String actual)
throws java.lang.Exception
expected - the expected JSON contentactual - the actual JSON contentjava.lang.ExceptionassertJsonEqual(String, String, boolean)public void assertJsonEqual(java.lang.String expected,
java.lang.String actual,
boolean strict)
throws java.lang.Exception
Can compare in two modes, depending on strict parameter value:
true: strict checking. Not extensible, and strict array ordering.false: lenient checking. Extensible, and non-strict array ordering.expected - the expected JSON contentactual - the actual JSON contentstrict - enables strict checkingjava.lang.Exceptionpublic void assertJsonNotEqual(java.lang.String expected,
java.lang.String actual)
throws java.lang.Exception
expected - the expected JSON contentactual - the actual JSON contentjava.lang.ExceptionassertJsonNotEqual(String, String, boolean)public void assertJsonNotEqual(java.lang.String expected,
java.lang.String actual,
boolean strict)
throws java.lang.Exception
Can compare in two modes, depending on strict parameter value:
true: strict checking. Not extensible, and strict array ordering.false: lenient checking. Extensible, and non-strict array ordering.expected - the expected JSON contentactual - the actual JSON contentstrict - enables strict checkingjava.lang.Exception