类 JsonContentAssert
- java.lang.Object
- org.assertj.core.api.AbstractAssert<JsonContentAssert,CharSequence>
- org.springframework.boot.test.json.JsonContentAssert
- 所有已实现的接口:
org.assertj.core.api.Assert<JsonContentAssert,CharSequence>,org.assertj.core.api.Descriptable<JsonContentAssert>,org.assertj.core.api.ExtensionPoints<JsonContentAssert,CharSequence>
public class JsonContentAssert extends org.assertj.core.api.AbstractAssert<JsonContentAssert,CharSequence>
AssertJAssertforJsonContent.- 从以下版本开始:
- 1.4.0
构造器概要
构造器 构造器 说明 JsonContentAssert(Class<?> resourceLoadClass, CharSequence json)Create a newJsonContentAssertinstance that will load resources as UTF-8.JsonContentAssert(Class<?> resourceLoadClass, Charset charset, CharSequence json)Create a newJsonContentAssertinstance that will load resources in the givencharset.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 JsonContentAssertdoesNotHaveEmptyJsonPathValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path does not produce anemptyresult.JsonContentAssertdoesNotHaveJsonPathValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces no result.<E> org.assertj.core.api.ListAssert<E>extractingJsonPathArrayValue(CharSequence expression, Object... args)Extract the array value at the given JSON path for further object assertions.org.assertj.core.api.AbstractBooleanAssert<?>extractingJsonPathBooleanValue(CharSequence expression, Object... args)Extract the boolean value at the given JSON path for further object assertions.<K,V>
org.assertj.core.api.MapAssert<K,V>extractingJsonPathMapValue(CharSequence expression, Object... args)Extract the map value at the given JSON path for further object assertions.org.assertj.core.api.AbstractObjectAssert<?,Number>extractingJsonPathNumberValue(CharSequence expression, Object... args)Extract the number value at the given JSON path for further object assertions.org.assertj.core.api.AbstractCharSequenceAssert<?,String>extractingJsonPathStringValue(CharSequence expression, Object... args)Extract the string value at the given JSON path for further object assertions.org.assertj.core.api.AbstractObjectAssert<?,Object>extractingJsonPathValue(CharSequence expression, Object... args)Extract the value at the given JSON path for further object assertions.JsonContentAsserthasEmptyJsonPathValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces anemptyresult.JsonContentAsserthasJsonPathArrayValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null array result.JsonContentAsserthasJsonPathBooleanValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null boolean result.JsonContentAsserthasJsonPathMapValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null map result.JsonContentAsserthasJsonPathNumberValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null number result.JsonContentAsserthasJsonPathStringValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null string result.JsonContentAsserthasJsonPathValue(CharSequence expression, Object... args)Verify that the actual value at the given JSON path produces a non-null result.JsonContentAssertisEqualTo(Object expected)Overridden version ofisEqualToto perform JSON tests based on the object type.JsonContentAssertisEqualToJson(byte[] expected)Verifies that the actual value islenientlyequal to the specified JSON bytes.JsonContentAssertisEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON bytes.JsonContentAssertisEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON bytes.JsonContentAssertisEqualToJson(File expected)Verifies that the actual value islenientlyequal to the specified JSON file.JsonContentAssertisEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON file.JsonContentAssertisEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON file.JsonContentAssertisEqualToJson(InputStream expected)Verifies that the actual value islenientlyequal to the specified JSON input stream.JsonContentAssertisEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON input stream.JsonContentAssertisEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON input stream.JsonContentAssertisEqualToJson(CharSequence expected)Verifies that the actual value islenientlyequal to the specified JSON.JsonContentAssertisEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON.JsonContentAssertisEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON.JsonContentAssertisEqualToJson(String path, Class<?> resourceLoadClass)Verifies that the actual value islenientlyequal to the specified JSON resource.JsonContentAssertisEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON resource.JsonContentAssertisEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON resource.JsonContentAssertisEqualToJson(org.springframework.core.io.Resource expected)Verifies that the actual value islenientlyequal to the specified JSON resource.JsonContentAssertisEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is equal to the specified JSON resource.JsonContentAssertisEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is equal to the specified JSON resource.JsonContentAssertisNotEqualTo(Object expected)Overridden version ofisNotEqualToto perform JSON tests based on the object type.JsonContentAssertisNotEqualToJson(byte[] expected)Verifies that the actual value is notlenientlyequal to the specified JSON bytes.JsonContentAssertisNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON bytes.JsonContentAssertisNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON bytes.JsonContentAssertisNotEqualToJson(File expected)Verifies that the actual value is notlenientlyequal to the specified JSON file.JsonContentAssertisNotEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON file.JsonContentAssertisNotEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON file.JsonContentAssertisNotEqualToJson(InputStream expected)Verifies that the actual value is notlenientlyequal to the specified JSON input stream.JsonContentAssertisNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON input stream.JsonContentAssertisNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON input stream.JsonContentAssertisNotEqualToJson(CharSequence expected)Verifies that the actual value is notlenientlyequal to the specified JSON.JsonContentAssertisNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON.JsonContentAssertisNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON.JsonContentAssertisNotEqualToJson(String path, Class<?> resourceLoadClass)Verifies that the actual value is notlenientlyequal to the specified JSON resource.JsonContentAssertisNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON resource.JsonContentAssertisNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON resource.JsonContentAssertisNotEqualToJson(org.springframework.core.io.Resource expected)Verifies that the actual value is notlenientlyequal to the specified JSON resource.JsonContentAssertisNotEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)Verifies that the actual value is not equal to the specified JSON resource.JsonContentAssertisNotEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)Verifies that the actual value is not equal to the specified JSON resource.JsonContentAssertisNotStrictlyEqualToJson(byte[] expected)Verifies that the actual value is notstrictlyequal to the specified JSON bytes.JsonContentAssertisNotStrictlyEqualToJson(File expected)Verifies that the actual value is notstrictlyequal to the specified JSON file.JsonContentAssertisNotStrictlyEqualToJson(InputStream expected)Verifies that the actual value is notstrictlyequal to the specified JSON input stream.JsonContentAssertisNotStrictlyEqualToJson(CharSequence expected)Verifies that the actual value is notstrictlyequal to the specified JSON.JsonContentAssertisNotStrictlyEqualToJson(String path, Class<?> resourceLoadClass)Verifies that the actual value is notstrictlyequal to the specified JSON resource.JsonContentAssertisNotStrictlyEqualToJson(org.springframework.core.io.Resource expected)Verifies that the actual value is notstrictlyequal to the specified JSON resource.JsonContentAssertisStrictlyEqualToJson(byte[] expected)Verifies that the actual value isstrictlyequal to the specified JSON bytes.JsonContentAssertisStrictlyEqualToJson(File expected)Verifies that the actual value isstrictlyequal to the specified JSON file.JsonContentAssertisStrictlyEqualToJson(InputStream expected)Verifies that the actual value isstrictlyequal to the specified JSON input stream.JsonContentAssertisStrictlyEqualToJson(CharSequence expected)Verifies that the actual value isstrictlyequal to the specified JSON.JsonContentAssertisStrictlyEqualToJson(String path, Class<?> resourceLoadClass)Verifies that the actual value isstrictlyequal to the specified JSON resource.JsonContentAssertisStrictlyEqualToJson(org.springframework.core.io.Resource expected)Verifies that the actual value isstrictlyequal to the specified JSON resource.从类继承的方法 org.assertj.core.api.AbstractAssert
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
构造器详细资料
JsonContentAssert
public JsonContentAssert(Class<?> resourceLoadClass, CharSequence json)
Create a newJsonContentAssertinstance that will load resources as UTF-8.- 参数:
resourceLoadClass- the source class used to load resourcesjson- the actual JSON content
JsonContentAssert
public JsonContentAssert(Class<?> resourceLoadClass, Charset charset, CharSequence json)
Create a newJsonContentAssertinstance that will load resources in the givencharset.- 参数:
resourceLoadClass- the source class used to load resourcescharset- the charset of the JSON resourcesjson- the actual JSON content- 从以下版本开始:
- 1.4.1
方法详细资料
isEqualTo
public JsonContentAssert isEqualTo(Object expected)
Overridden version ofisEqualToto perform JSON tests based on the object type.- 指定者:
isEqualTo在接口中org.assertj.core.api.Assert<JsonContentAssert,CharSequence>- 覆盖:
isEqualTo在类中org.assertj.core.api.AbstractAssert<JsonContentAssert,CharSequence>- 另请参阅:
AbstractAssert.isEqualTo(java.lang.Object)
isEqualToJson
public JsonContentAssert isEqualToJson(CharSequence expected)
Verifies that the actual value islenientlyequal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(String path, Class<?> resourceLoadClass)
Verifies that the actual value islenientlyequal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resource- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(byte[] expected)
Verifies that the actual value islenientlyequal to the specified JSON bytes.- 参数:
expected- the expected JSON bytes- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(File expected)
Verifies that the actual value islenientlyequal to the specified JSON file.- 参数:
expected- a file containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(InputStream expected)
Verifies that the actual value islenientlyequal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(org.springframework.core.io.Resource expected)
Verifies that the actual value islenientlyequal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(CharSequence expected)
Verifies that the actual value isstrictlyequal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(String path, Class<?> resourceLoadClass)
Verifies that the actual value isstrictlyequal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resource- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(byte[] expected)
Verifies that the actual value isstrictlyequal to the specified JSON bytes.- 参数:
expected- the expected JSON bytes- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(File expected)
Verifies that the actual value isstrictlyequal to the specified JSON file.- 参数:
expected- a file containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(InputStream expected)
Verifies that the actual value isstrictlyequal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isStrictlyEqualToJson
public JsonContentAssert isStrictlyEqualToJson(org.springframework.core.io.Resource expected)
Verifies that the actual value isstrictlyequal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resourcecompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON bytes.- 参数:
expected- the expected JSON bytescompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON file.- 参数:
expected- a file containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is equal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resourcecomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON bytes.- 参数:
expected- the expected JSON bytescomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON file.- 参数:
expected- a file containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isEqualToJson
public JsonContentAssert isEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is equal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is not equal to the given one
isNotEqualTo
public JsonContentAssert isNotEqualTo(Object expected)
Overridden version ofisNotEqualToto perform JSON tests based on the object type.- 指定者:
isNotEqualTo在接口中org.assertj.core.api.Assert<JsonContentAssert,CharSequence>- 覆盖:
isNotEqualTo在类中org.assertj.core.api.AbstractAssert<JsonContentAssert,CharSequence>- 另请参阅:
AbstractAssert.isEqualTo(java.lang.Object)
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(CharSequence expected)
Verifies that the actual value is notlenientlyequal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(String path, Class<?> resourceLoadClass)
Verifies that the actual value is notlenientlyequal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resource- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(byte[] expected)
Verifies that the actual value is notlenientlyequal to the specified JSON bytes.- 参数:
expected- the expected JSON bytes- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(File expected)
Verifies that the actual value is notlenientlyequal to the specified JSON file.- 参数:
expected- a file containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(InputStream expected)
Verifies that the actual value is notlenientlyequal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(org.springframework.core.io.Resource expected)
Verifies that the actual value is notlenientlyequal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(CharSequence expected)
Verifies that the actual value is notstrictlyequal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(String path, Class<?> resourceLoadClass)
Verifies that the actual value is notstrictlyequal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resource- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(byte[] expected)
Verifies that the actual value is notstrictlyequal to the specified JSON bytes.- 参数:
expected- the expected JSON bytes- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(File expected)
Verifies that the actual value is notstrictlyequal to the specified JSON file.- 参数:
expected- a file containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(InputStream expected)
Verifies that the actual value is notstrictlyequal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotStrictlyEqualToJson
public JsonContentAssert isNotStrictlyEqualToJson(org.springframework.core.io.Resource expected)
Verifies that the actual value is notstrictlyequal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSON- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resourcecompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON bytes.- 参数:
expected- the expected JSON bytescompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON file.- 参数:
expected- a file containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode)
Verifies that the actual value is not equal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSONcompareMode- the compare mode used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON. Theexpectedvalue can contain the JSON itself or, if it ends with.json, the name of a resource to be loaded usingresourceLoadClass.- 参数:
expected- the expected JSON or the name of a resource containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON resource.- 参数:
path- the name of a resource containing the expected JSONresourceLoadClass- the source class used to load the resourcecomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON bytes.- 参数:
expected- the expected JSON bytescomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON file.- 参数:
expected- a file containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON input stream.- 参数:
expected- an input stream containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
isNotEqualToJson
public JsonContentAssert isNotEqualToJson(org.springframework.core.io.Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
Verifies that the actual value is not equal to the specified JSON resource.- 参数:
expected- a resource containing the expected JSONcomparator- the comparator used when checking- 返回:
thisassertion object- 抛出:
AssertionError- if the actual JSON value is equal to the given one
hasJsonPathValue
public JsonContentAssert hasJsonPathValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null result. If the JSON path expression is not definite, this method verifies that the value at the given path is not empty.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing
hasJsonPathStringValue
public JsonContentAssert hasJsonPathStringValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null string result.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing or not a string
hasJsonPathNumberValue
public JsonContentAssert hasJsonPathNumberValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null number result.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing or not a number
hasJsonPathBooleanValue
public JsonContentAssert hasJsonPathBooleanValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null boolean result.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing or not a boolean
hasJsonPathArrayValue
public JsonContentAssert hasJsonPathArrayValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null array result.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing or not an array
hasJsonPathMapValue
public JsonContentAssert hasJsonPathMapValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces a non-null map result.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is missing or not a map
hasEmptyJsonPathValue
public JsonContentAssert hasEmptyJsonPathValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces anemptyresult.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is not empty
doesNotHaveJsonPathValue
public JsonContentAssert doesNotHaveJsonPathValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path produces no result. If the JSON path expression is not definite, this method verifies that the value at the given path is empty.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is not missing
doesNotHaveEmptyJsonPathValue
public JsonContentAssert doesNotHaveEmptyJsonPathValue(CharSequence expression, Object... args)
Verify that the actual value at the given JSON path does not produce anemptyresult.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
thisassertion object- 抛出:
AssertionError- if the value at the given path is empty
extractingJsonPathValue
public org.assertj.core.api.AbstractObjectAssert<?,Object> extractingJsonPathValue(CharSequence expression, Object... args)
Extract the value at the given JSON path for further object assertions.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid
extractingJsonPathStringValue
public org.assertj.core.api.AbstractCharSequenceAssert<?,String> extractingJsonPathStringValue(CharSequence expression, Object... args)
Extract the string value at the given JSON path for further object assertions.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid or does not result in a string
extractingJsonPathNumberValue
public org.assertj.core.api.AbstractObjectAssert<?,Number> extractingJsonPathNumberValue(CharSequence expression, Object... args)
Extract the number value at the given JSON path for further object assertions.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid or does not result in a number
extractingJsonPathBooleanValue
public org.assertj.core.api.AbstractBooleanAssert<?> extractingJsonPathBooleanValue(CharSequence expression, Object... args)
Extract the boolean value at the given JSON path for further object assertions.- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid or does not result in a boolean
extractingJsonPathArrayValue
public <E> org.assertj.core.api.ListAssert<E> extractingJsonPathArrayValue(CharSequence expression, Object... args)
Extract the array value at the given JSON path for further object assertions.- 类型参数:
E- element type- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid or does not result in an array
extractingJsonPathMapValue
public <K,V> org.assertj.core.api.MapAssert<K,V> extractingJsonPathMapValue(CharSequence expression, Object... args)
Extract the map value at the given JSON path for further object assertions.- 类型参数:
K- key typeV- value type- 参数:
expression- theJsonPathexpressionargs- arguments to parameterize theJsonPathexpression with, using formatting specifiers defined inString.format(String, Object...)- 返回:
- a new assertion object whose object under test is the extracted item
- 抛出:
AssertionError- if the path is not valid or does not result in a map