类 JsonExpectationsHelper
java.lang.Object
cn.taketoday.test.util.JsonExpectationsHelper
A helper class for assertions on JSON content.
Use of this class requires the JSONassert library.
- 从以下版本开始:
- 4.0
- 作者:
- Sebastien Deleuze
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidassertJsonEqual(String expected, String actual) 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).voidassertJsonEqual(String expected, String actual, boolean strict) 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.voidassertJsonNotEqual(String expected, String actual) 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).voidassertJsonNotEqual(String expected, String actual, boolean strict) 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.
-
构造器详细资料
-
JsonExpectationsHelper
public JsonExpectationsHelper()
-
-
方法详细资料
-
assertJsonEqual
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).- 参数:
expected- the expected JSON contentactual- the actual JSON content- 抛出:
Exception- 另请参阅:
-
assertJsonEqual
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.
- 参数:
expected- the expected JSON contentactual- the actual JSON contentstrict- enables strict checking iftrue- 抛出:
Exception
-
assertJsonNotEqual
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).- 参数:
expected- the expected JSON contentactual- the actual JSON content- 抛出:
Exception- 另请参阅:
-
assertJsonNotEqual
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.
- 参数:
expected- the expected JSON contentactual- the actual JSON contentstrict- enables strict checking- 抛出:
Exception
-