Class JsonContentAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<JsonContentAssert, CharSequence>
org.springframework.boot.test.json.JsonContentAssert
- All Implemented Interfaces:
- 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>
AssertJ 
Assert for JsonContent.- Since:
- 1.4.0
- Author:
- Phillip Webb, Andy Wilkinson, Diego Berrueta, Camille Vienot
- 
Field SummaryFields inherited from class org.assertj.core.api.AbstractAssertactual, info, myself, objects, throwUnsupportedExceptionOnEquals
- 
Constructor SummaryConstructorsConstructorDescriptionJsonContentAssert(Class<?> resourceLoadClass, @Nullable CharSequence json) Create a newJsonContentAssertinstance that will load resources as UTF-8.JsonContentAssert(Class<?> resourceLoadClass, @Nullable Charset charset, @Nullable CharSequence json) Create a newJsonContentAssertinstance that will load resources in the givencharset.
- 
Method SummaryModifier and TypeMethodDescriptiondoesNotHaveEmptyJsonPathValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path does not produce anemptyresult.doesNotHaveJsonPath(CharSequence expression, Object... args) Verify that the JSON path is not present, even if it has anullvalue.doesNotHaveJsonPathValue(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.hasEmptyJsonPathValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces anemptyresult.hasJsonPath(CharSequence expression, Object... args) Verify that the JSON path is present without checking if it has a value.hasJsonPathArrayValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null array result.hasJsonPathBooleanValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null boolean result.hasJsonPathMapValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null map result.hasJsonPathNumberValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null number result.hasJsonPathStringValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null string result.hasJsonPathValue(CharSequence expression, Object... args) Verify that the actual value at the given JSON path produces a non-null result.Overridden version ofisEqualToto perform JSON tests based on the object type.isEqualToJson(byte[] expected) Verifies that the actual value islenientlyequal to the specified JSON bytes.isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON bytes.isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON bytes.isEqualToJson(File expected) Verifies that the actual value islenientlyequal to the specified JSON file.isEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON file.isEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON file.isEqualToJson(InputStream expected) Verifies that the actual value islenientlyequal to the specified JSON input stream.isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON input stream.isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON input stream.isEqualToJson(@Nullable CharSequence expected) Verifies that the actual value islenientlyequal to the specified JSON.isEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON.isEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON.isEqualToJson(String path, Class<?> resourceLoadClass) Verifies that the actual value islenientlyequal to the specified JSON resource.isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON resource.isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON resource.isEqualToJson(Resource expected) Verifies that the actual value islenientlyequal to the specified JSON resource.isEqualToJson(Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON resource.isEqualToJson(Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON resource.isNotEqualTo(@Nullable Object expected) Overridden version ofisNotEqualToto perform JSON tests based on the object type.isNotEqualToJson(byte[] expected) Verifies that the actual value is notlenientlyequal to the specified JSON bytes.isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON bytes.isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON bytes.isNotEqualToJson(File expected) Verifies that the actual value is notlenientlyequal to the specified JSON file.isNotEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON file.isNotEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON file.isNotEqualToJson(InputStream expected) Verifies that the actual value is notlenientlyequal to the specified JSON input stream.isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON input stream.isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON input stream.isNotEqualToJson(@Nullable CharSequence expected) Verifies that the actual value is notlenientlyequal to the specified JSON.isNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON.isNotEqualToJson(CharSequence expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON.isNotEqualToJson(String path, Class<?> resourceLoadClass) Verifies that the actual value is notlenientlyequal to the specified JSON resource.isNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON resource.isNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON resource.isNotEqualToJson(Resource expected) Verifies that the actual value is notlenientlyequal to the specified JSON resource.isNotEqualToJson(Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON resource.isNotEqualToJson(Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON resource.isNotStrictlyEqualToJson(byte[] expected) Verifies that the actual value is notstrictlyequal to the specified JSON bytes.isNotStrictlyEqualToJson(File expected) Verifies that the actual value is notstrictlyequal to the specified JSON file.isNotStrictlyEqualToJson(InputStream expected) Verifies that the actual value is notstrictlyequal to the specified JSON input stream.isNotStrictlyEqualToJson(CharSequence expected) Verifies that the actual value is notstrictlyequal to the specified JSON.isNotStrictlyEqualToJson(String path, Class<?> resourceLoadClass) Verifies that the actual value is notstrictlyequal to the specified JSON resource.isNotStrictlyEqualToJson(Resource expected) Verifies that the actual value is notstrictlyequal to the specified JSON resource.isStrictlyEqualToJson(byte[] expected) Verifies that the actual value isstrictlyequal to the specified JSON bytes.isStrictlyEqualToJson(File expected) Verifies that the actual value isstrictlyequal to the specified JSON file.isStrictlyEqualToJson(InputStream expected) Verifies that the actual value isstrictlyequal to the specified JSON input stream.isStrictlyEqualToJson(CharSequence expected) Verifies that the actual value isstrictlyequal to the specified JSON.isStrictlyEqualToJson(String path, Class<?> resourceLoadClass) Verifies that the actual value isstrictlyequal to the specified JSON resource.isStrictlyEqualToJson(Resource expected) Verifies that the actual value isstrictlyequal to the specified JSON resource.Methods inherited from class org.assertj.core.api.AbstractAssertactual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptableas, as, as, describedAs, describedAs
- 
Constructor Details- 
JsonContentAssertCreate a newJsonContentAssertinstance that will load resources as UTF-8.- Parameters:
- resourceLoadClass- the source class used to load resources
- json- the actual JSON content
 
- 
JsonContentAssertpublic JsonContentAssert(Class<?> resourceLoadClass, @Nullable Charset charset, @Nullable CharSequence json) Create a newJsonContentAssertinstance that will load resources in the givencharset.- Parameters:
- resourceLoadClass- the source class used to load resources
- charset- the charset of the JSON resources
- json- the actual JSON content
- Since:
- 1.4.1
 
 
- 
- 
Method Details- 
isEqualToOverridden version ofisEqualToto perform JSON tests based on the object type.- Specified by:
- isEqualToin interface- org.assertj.core.api.Assert<JsonContentAssert, CharSequence>
- Overrides:
- isEqualToin class- org.assertj.core.api.AbstractAssert<JsonContentAssert, CharSequence>
- See Also:
 
- 
isEqualToJsonVerifies 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonVerifies that the actual value islenientlyequal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonVerifies that the actual value islenientlyequal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonVerifies that the actual value islenientlyequal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonVerifies that the actual value islenientlyequal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonVerifies that the actual value islenientlyequal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies that the actual value isstrictlyequal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies that the actual value isstrictlyequal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies that the actual value isstrictlyequal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies that the actual value isstrictlyequal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isStrictlyEqualToJsonVerifies that the actual value isstrictlyequal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is equal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isEqualToJsonpublic JsonContentAssert isEqualToJson(Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is equal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is not equal to the given one
 
- 
isNotEqualToOverridden version ofisNotEqualToto perform JSON tests based on the object type.- Specified by:
- isNotEqualToin interface- org.assertj.core.api.Assert<JsonContentAssert, CharSequence>
- Overrides:
- isNotEqualToin class- org.assertj.core.api.AbstractAssert<JsonContentAssert, CharSequence>
- See Also:
 
- 
isNotEqualToJsonVerifies 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonVerifies that the actual value is notlenientlyequal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonVerifies that the actual value is notlenientlyequal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonVerifies that the actual value is notlenientlyequal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonVerifies that the actual value is notlenientlyequal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonVerifies that the actual value is notlenientlyequal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies that the actual value is notstrictlyequal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies that the actual value is notstrictlyequal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies that the actual value is notstrictlyequal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies that the actual value is notstrictlyequal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotStrictlyEqualToJsonVerifies that the actual value is notstrictlyequal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(String path, Class<?> resourceLoadClass, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON resource.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(File expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(Resource expected, org.skyscreamer.jsonassert.JSONCompareMode compareMode) Verifies that the actual value is not equal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- compareMode- the compare mode used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic 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.- Parameters:
- expected- the expected JSON or the name of a resource containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic 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.- Parameters:
- path- the name of a resource containing the expected JSON
- resourceLoadClass- the source class used to load the resource
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(byte[] expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON bytes.- Parameters:
- expected- the expected JSON bytes
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(File expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON file.- Parameters:
- expected- a file containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(InputStream expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON input stream.- Parameters:
- expected- an input stream containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
isNotEqualToJsonpublic JsonContentAssert isNotEqualToJson(Resource expected, org.skyscreamer.jsonassert.comparator.JSONComparator comparator) Verifies that the actual value is not equal to the specified JSON resource.- Parameters:
- expected- a resource containing the expected JSON
- comparator- the comparator used when checking
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the actual JSON value is equal to the given one
 
- 
hasJsonPathVerify that the JSON path is present without checking if it has a value.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing
- Since:
- 2.2.0
- See Also:
 
- 
hasJsonPathValueVerify 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.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing
 
- 
hasJsonPathStringValueVerify that the actual value at the given JSON path produces a non-null string result.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing or not a string
 
- 
hasJsonPathNumberValueVerify that the actual value at the given JSON path produces a non-null number result.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing or not a number
 
- 
hasJsonPathBooleanValueVerify that the actual value at the given JSON path produces a non-null boolean result.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing or not a boolean
 
- 
hasJsonPathArrayValueVerify that the actual value at the given JSON path produces a non-null array result.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing or not an array
 
- 
hasJsonPathMapValueVerify that the actual value at the given JSON path produces a non-null map result.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is missing or not a map
 
- 
hasEmptyJsonPathValueVerify that the actual value at the given JSON path produces anemptyresult.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is not empty
 
- 
doesNotHaveJsonPathVerify that the JSON path is not present, even if it has anullvalue.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is not missing
- Since:
- 2.2.0
- See Also:
 
- 
doesNotHaveJsonPathValueVerify 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.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is not missing
 
- 
doesNotHaveEmptyJsonPathValueVerify that the actual value at the given JSON path does not produce anemptyresult.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- thisassertion object
- Throws:
- AssertionError- if the value at the given path is empty
 
- 
extractingJsonPathValuepublic org.assertj.core.api.AbstractObjectAssert<?,Object> extractingJsonPathValue(CharSequence expression, Object... args) Extract the value at the given JSON path for further object assertions.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid
 
- 
extractingJsonPathStringValuepublic org.assertj.core.api.AbstractCharSequenceAssert<?,String> extractingJsonPathStringValue(CharSequence expression, Object... args) Extract the string value at the given JSON path for further object assertions.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid or does not result in a string
 
- 
extractingJsonPathNumberValuepublic org.assertj.core.api.AbstractObjectAssert<?,Number> extractingJsonPathNumberValue(CharSequence expression, Object... args) Extract the number value at the given JSON path for further object assertions.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid or does not result in a number
 
- 
extractingJsonPathBooleanValuepublic org.assertj.core.api.AbstractBooleanAssert<?> extractingJsonPathBooleanValue(CharSequence expression, Object... args) Extract the boolean value at the given JSON path for further object assertions.- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid or does not result in a boolean
 
- 
extractingJsonPathArrayValuepublic <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.- Type Parameters:
- E- element type
- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid or does not result in an array
 
- 
extractingJsonPathMapValuepublic <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.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- expression- the- JsonPathexpression
- args- arguments to parameterize the- JsonPathexpression with, using formatting specifiers defined in- String.format(String, Object...)
- Returns:
- a new assertion object whose object under test is the extracted item
- Throws:
- AssertionError- if the path is not valid or does not result in a map
 
 
-