Class JsonExpectationsHelper
java.lang.Object
org.springframework.test.util.JsonExpectationsHelper
Deprecated.
A helper class for assertions on JSON content.
 
Use of this class requires the JSONassert library.
- Since:
- 4.1
- Author:
- Sebastien Deleuze
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidassertJsonEqual(String expected, String actual) Deprecated.Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.voidassertJsonEqual(String expected, String actual, boolean strict) Deprecated.Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.voidassertJsonNotEqual(String expected, String actual) Deprecated.Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.voidassertJsonNotEqual(String expected, String actual, boolean strict) Deprecated.Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.
- 
Constructor Details- 
JsonExpectationsHelperpublic JsonExpectationsHelper()Deprecated.
 
- 
- 
Method Details- 
assertJsonEqualDeprecated.Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting with lenient checking (extensible content and non-strict array ordering).- Parameters:
- expected- the expected JSON content
- actual- the actual JSON content
- Throws:
- Exception
- Since:
- 4.1
- See Also:
 
- 
assertJsonEqualDeprecated.Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting.Can compare in two modes, depending on the strictparameter value:- true: strict checking. Not extensible and strict array ordering.
- false: lenient checking. Extensible and non-strict array ordering.
 - Parameters:
- expected- the expected JSON content
- actual- the actual JSON content
- strict- enables strict checking if- true
- Throws:
- Exception
- Since:
- 4.2
 
- 
assertJsonNotEqualDeprecated.Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e. they contain different attribute-value pairs regardless of formatting with a lenient checking (extensible, and non-strict array ordering).- Parameters:
- expected- the expected JSON content
- actual- the actual JSON content
- Throws:
- Exception
- Since:
- 4.1
- See Also:
 
- 
assertJsonNotEqualDeprecated.Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e. they contain different attribute-value pairs regardless of formatting.Can compare in two modes, depending on strictparameter value:- true: strict checking. Not extensible, and strict array ordering.
- false: lenient checking. Extensible, and non-strict array ordering.
 - Parameters:
- expected- the expected JSON content
- actual- the actual JSON content
- strict- enables strict checking
- Throws:
- Exception
- Since:
- 4.2
 
 
- 
JSONAssertdirectly or theJsonComparatorabstraction