JsonContentAssert

open class JsonContentAssert : AbstractAssert<SELF, ACTUAL>

AssertJ Assert for JsonContent.

Author

Phillip Webb

Andy Wilkinson

Diego Berrueta

Camille Vienot

Since

1.4.0

Constructors

Link copied to clipboard
constructor(resourceLoadClass: Class<out Any>, json: CharSequence)
Create a new JsonContentAssert instance that will load resources as UTF-8.
constructor(resourceLoadClass: Class<out Any>, charset: Charset, json: CharSequence)
Create a new JsonContentAssert instance that will load resources in the given charset.

Properties

Link copied to clipboard
open var info: WritableAssertionInfo

Functions

Link copied to clipboard
open fun as(description: String, args: Array<Any>): SELF
Link copied to clipboard
open fun <ASSERT : AbstractAssert<out Any, out Any>?> asInstanceOf(instanceOfAssertFactory: InstanceOfAssertFactory<out Any, ASSERT>): ASSERT
Link copied to clipboard
open fun asList(): AbstractListAssert<out Any, List<out Any>, Any, ObjectAssert<Any>>
Link copied to clipboard
open fun asString(): AbstractStringAssert<out Any>
abstract fun asString(): AbstractCharSequenceAssert<out Any, String>
Link copied to clipboard
open fun describedAs(description: Description): SELF
Link copied to clipboard
Link copied to clipboard
open fun doesNotHave(condition: Condition<in ACTUAL>): SELF
Link copied to clipboard
Verify that the actual value at the given JSON path does not produce an empty result.
Link copied to clipboard
Verify that the JSON path is not present, even if it has a null value.
Link copied to clipboard
Verify that the actual value at the given JSON path produces no result.
Link copied to clipboard
open fun doesNotHaveSameClassAs(other: Any): SELF
Link copied to clipboard
open fun doesNotHaveSameHashCodeAs(other: Any): SELF
Link copied to clipboard
open fun doesNotHaveToString(otherToString: String): SELF
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
open fun <E> extractingJsonPathArrayValue(expression: CharSequence, args: Array<Any>): ListAssert<E>
Extract the array value at the given JSON path for further object assertions.
Link copied to clipboard
open fun extractingJsonPathBooleanValue(expression: CharSequence, args: Array<Any>): AbstractBooleanAssert<out Any>
Extract the boolean value at the given JSON path for further object assertions.
Link copied to clipboard
open fun <K, V> extractingJsonPathMapValue(expression: CharSequence, args: Array<Any>): MapAssert<K, V>
Extract the map value at the given JSON path for further object assertions.
Link copied to clipboard
open fun extractingJsonPathNumberValue(expression: CharSequence, args: Array<Any>): AbstractObjectAssert<out Any, Number>
Extract the number value at the given JSON path for further object assertions.
Link copied to clipboard
open fun extractingJsonPathStringValue(expression: CharSequence, args: Array<Any>): AbstractCharSequenceAssert<out Any, String>
Extract the string value at the given JSON path for further object assertions.
Link copied to clipboard
open fun extractingJsonPathValue(expression: CharSequence, args: Array<Any>): AbstractObjectAssert<out Any, Any>
Extract the value at the given JSON path for further object assertions.
Link copied to clipboard
open fun getWritableAssertionInfo(): WritableAssertionInfo
Link copied to clipboard
open fun has(condition: Condition<in ACTUAL>): SELF
Link copied to clipboard
Verify that the actual value at the given JSON path produces an empty result.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun hasJsonPath(expression: CharSequence, args: Array<Any>): JsonContentAssert
Verify that the JSON path is present without checking if it has a value.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null array result.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null boolean result.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null map result.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null number result.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null string result.
Link copied to clipboard
Verify that the actual value at the given JSON path produces a non-null result.
Link copied to clipboard
open fun hasSameClassAs(other: Any): SELF
Link copied to clipboard
open fun hasSameHashCodeAs(other: Any): SELF
Link copied to clipboard
open fun hasToString(expectedToString: String): SELF
Link copied to clipboard
open fun is(condition: Condition<in ACTUAL>): SELF
Link copied to clipboard
open fun isEqualTo(expected: Any): JsonContentAssert
Overridden version of isEqualTo to perform JSON tests based on the object type.
Link copied to clipboard
Verifies that the actual value is leniently equal to the specified JSON bytes.
open fun isEqualToJson(expected: File): JsonContentAssert
Verifies that the actual value is leniently equal to the specified JSON file.
Verifies that the actual value is leniently equal to the specified JSON input stream.
Verifies that the actual value is leniently equal to the specified JSON.
open fun isEqualToJson(path: String, resourceLoadClass: Class<out Any>): JsonContentAssert
Verifies that the actual value is leniently equal to the specified JSON resource.
open fun isEqualToJson(expected: Array<Byte>, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(expected: Array<Byte>, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is equal to the specified JSON bytes.
open fun isEqualToJson(expected: File, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(expected: File, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is equal to the specified JSON file.
open fun isEqualToJson(expected: InputStream, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(expected: InputStream, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is equal to the specified JSON input stream.
open fun isEqualToJson(expected: CharSequence, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(expected: CharSequence, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is equal to the specified JSON.
open fun isEqualToJson(expected: Resource, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(expected: Resource, comparator: JSONComparator): JsonContentAssert
open fun isEqualToJson(path: String, resourceLoadClass: Class<out Any>, compareMode: JSONCompareMode): JsonContentAssert
open fun isEqualToJson(path: String, resourceLoadClass: Class<out Any>, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is equal to the specified JSON resource.
Link copied to clipboard
open fun isExactlyInstanceOf(type: Class<out Any>): SELF
Link copied to clipboard
open fun isIn(values: Array<Any>): SELF
Link copied to clipboard
open fun isInstanceOf(type: Class<out Any>): SELF
Link copied to clipboard
open fun isInstanceOfAny(types: Array<Class<out Any>>): SELF
Link copied to clipboard
open fun <T> isInstanceOfSatisfying(type: Class<T>, requirements: Consumer<T>): SELF
Link copied to clipboard
open fun isNot(condition: Condition<in ACTUAL>): SELF
Link copied to clipboard
open fun isNotEqualTo(expected: Any): JsonContentAssert
Overridden version of isNotEqualTo to perform JSON tests based on the object type.
Link copied to clipboard
Verifies that the actual value is not leniently equal to the specified JSON bytes.
Verifies that the actual value is not leniently equal to the specified JSON file.
Verifies that the actual value is not leniently equal to the specified JSON input stream.
Verifies that the actual value is not leniently equal to the specified JSON.
open fun isNotEqualToJson(path: String, resourceLoadClass: Class<out Any>): JsonContentAssert
Verifies that the actual value is not leniently equal to the specified JSON resource.
open fun isNotEqualToJson(expected: Array<Byte>, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(expected: Array<Byte>, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is not equal to the specified JSON bytes.
open fun isNotEqualToJson(expected: File, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(expected: File, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is not equal to the specified JSON file.
open fun isNotEqualToJson(expected: InputStream, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(expected: InputStream, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is not equal to the specified JSON input stream.
open fun isNotEqualToJson(expected: CharSequence, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(expected: CharSequence, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is not equal to the specified JSON.
open fun isNotEqualToJson(expected: Resource, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(expected: Resource, comparator: JSONComparator): JsonContentAssert
open fun isNotEqualToJson(path: String, resourceLoadClass: Class<out Any>, compareMode: JSONCompareMode): JsonContentAssert
open fun isNotEqualToJson(path: String, resourceLoadClass: Class<out Any>, comparator: JSONComparator): JsonContentAssert
Verifies that the actual value is not equal to the specified JSON resource.
Link copied to clipboard
open fun isNotExactlyInstanceOf(type: Class<out Any>): SELF
Link copied to clipboard
open fun isNotIn(values: Array<Any>): SELF
Link copied to clipboard
open fun isNotInstanceOf(type: Class<out Any>): SELF
Link copied to clipboard
open fun isNotInstanceOfAny(types: Array<Class<out Any>>): SELF
Link copied to clipboard
open fun isNotNull(): SELF
Link copied to clipboard
open fun isNotOfAnyClassIn(types: Array<Class<out Any>>): SELF
Link copied to clipboard
open fun isNotSameAs(other: Any): SELF
Link copied to clipboard
Verifies that the actual value is not strictly equal to the specified JSON bytes.
Verifies that the actual value is not strictly equal to the specified JSON file.
Verifies that the actual value is not strictly equal to the specified JSON input stream.
Verifies that the actual value is not strictly equal to the specified JSON.
open fun isNotStrictlyEqualToJson(path: String, resourceLoadClass: Class<out Any>): JsonContentAssert
Verifies that the actual value is not strictly equal to the specified JSON resource.
Link copied to clipboard
open fun isNull()
Link copied to clipboard
open fun isOfAnyClassIn(types: Array<Class<out Any>>): SELF
Link copied to clipboard
open fun isSameAs(expected: Any): SELF
Link copied to clipboard
Verifies that the actual value is strictly equal to the specified JSON bytes.
Verifies that the actual value is strictly equal to the specified JSON file.
Verifies that the actual value is strictly equal to the specified JSON input stream.
Verifies that the actual value is strictly equal to the specified JSON.
open fun isStrictlyEqualToJson(path: String, resourceLoadClass: Class<out Any>): JsonContentAssert
Verifies that the actual value is strictly equal to the specified JSON resource.
Link copied to clipboard
open fun matches(predicate: Predicate<in ACTUAL>): SELF
Link copied to clipboard
open fun overridingErrorMessage(newErrorMessage: String, args: Array<Any>): SELF
Link copied to clipboard
open fun satisfies(condition: Condition<in ACTUAL>): SELF
Link copied to clipboard
fun satisfiesAnyOf(assertions: Array<Consumer<in ACTUAL>>): SELF
Link copied to clipboard
open fun setCustomRepresentation(customRepresentation: Representation)
Link copied to clipboard
open fun setDescriptionConsumer(descriptionConsumer: Consumer<Description>)
Link copied to clipboard
open fun setPrintAssertionsDescription(printAssertionsDescription: Boolean)
Link copied to clipboard
open fun usingComparator(customComparator: Comparator<in ACTUAL>): SELF
Link copied to clipboard
open fun usingDefaultComparator(): SELF
Link copied to clipboard
open fun withFailMessage(newErrorMessage: String, args: Array<Any>): SELF
Link copied to clipboard
open fun withRepresentation(representation: Representation): SELF
Link copied to clipboard
open fun withThreadDumpOnError(): SELF