Uses of Annotation Interface
org.assertj.core.util.CheckReturnValue
Packages that use CheckReturnValue
-
Uses of CheckReturnValue in org.assertj.core.api
Classes in org.assertj.core.api with annotations of type CheckReturnValueModifier and TypeClassDescriptionclass
Entry point for assertion methods for different types.class
Java 8 is picky when choosing the rightassertThat
method if the object under test is generic and bounded, for example if foo is instance of T that extends Exception, java 8 will complain that it can't resolve the properassertThat
method (normallyassertThat(Throwable)
as foo might implement an interface like List, if that occurredassertThat(List)
would also be a possible choice - thus confusing java 8.class
Entry point for assertion methods for different data types.class
Entry point for assumption methods for different types, which allow to skip test execution on failed assumptions.class
Behavior-driven development style entry point for assertion methods for different types.final class
Behavior-driven development style entry point for assumption methods for different types, which allow to skip test execution when assumptions are not met.interface
class
Deprecated.For Android compatible assertions use the latest assertj 2.x version which is based on Java 7 only.class
Deprecated.For Android compatible assertions use the latest assertj 2.x version which is based on Java 7 only.interface
AbstractBDDSoftAssertions compatible with Android.interface
AbstractStandardSoftAssertions compatible with Android.interface
interface
A unified entry point to all non-deprecated assertions from both the new Java 8 core API and the pre-Java 8 core API.interface
A unified entry point to all assumptions from both the new Java 8 core API and the pre-Java 8 core API.Methods in org.assertj.core.api with annotations of type CheckReturnValueModifier and TypeMethodDescriptionAbstractIterableAssert.as
(Description description) AbstractListAssert.as
(Description description) AbstractMapAssert.as
(Description description) AbstractObjectAssert.as
(Description description) AtomicReferenceArrayAssert.as
(Description description) AbstractStringAssert.asBase64Decoded()
Decodes the actual value as a Base64 encoded string, the decoded bytes becoming the new array under test.AbstractByteArrayAssert.asBase64Encoded()
Encodes the actual array into a Base64 string, the encoded string becoming the new object under test.AbstractByteArrayAssert.asHexString()
Converts the actual byte array under test to an hexadecimal String and returns assertions for the computed String allowing String specific assertions from this call.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractAssert.asInstanceOf
(InstanceOfAssertFactory<?, ASSERT> instanceOfAssertFactory) Uses anInstanceOfAssertFactory
to verify that the actual value is an instance of a given type and to produce a newAssert
narrowed to that type.AbstractAssert.asList()
Verifies that the actual value is an instance of List, and returns a list assertion, to allow chaining of list-specific assertions from this call.AbstractAssert.asString()
Returns a String assertion for thetoString()
of the actual value, to allow chaining of String-specific assertions from this call.AbstractByteArrayAssert.asString()
Converts the actual byte[] under test to a String and returns assertions for the computed String allowing String specific assertions from this call.Converts the actual byte[] under test to a String by decoding the specified bytes using the given charset and returns assertions for the computed String allowing String specific assertions from this call.Converts the content of the actualInputStream
to aString
by decoding its bytes using the given charset and returns assertions for the computed String allowing String specific assertions from this call.AbstractStringAssert.decodedAsBase64()
Deprecated.useAbstractStringAssert.asBase64Decoded()
instead.AbstractAssert.describedAs
(Description description) Sets the description of the assertion that is going to be called after.AbstractIterableAssert.describedAs
(String description, Object... args) AbstractIterableAssert.describedAs
(Description description) AbstractListAssert.describedAs
(String description, Object... args) AbstractListAssert.describedAs
(Description description) AbstractMapAssert.describedAs
(String description, Object... args) AbstractMapAssert.describedAs
(Description description) NotThrownAssert.describedAs
(Description description) Sets the description of the assertion that is going to be called after.SoftThrowableTypeAssert.describedAs
(Description description) ThrowableAssertAlternative.describedAs
(String description, Object... args) Sets the description of the assertion that is going to be called after.ThrowableAssertAlternative.describedAs
(Description description) Sets the description of the assertion that is going to be called after.ThrowableTypeAssert.describedAs
(Description description) Sets the description of the assertion that is going to be called after.AbstractIterableAssert.element
(int index) Navigate and allow to perform assertions on the chosen element of theIterable
under test.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractIterableAssert.element
(int index, InstanceOfAssertFactory<?, ASSERT> assertFactory) Navigate and allow to perform assertions on the chosen element of theIterable
under test.AbstractIterableAssert.elements
(int... indices) Allow to perform assertions on the elements corresponding to the given indices (the iterableIterable
under test is changed to an iterable with the selected elements).AbstractByteArrayAssert.encodedAsBase64()
Deprecated.useAbstractByteArrayAssert.asBase64Encoded()
instead.protected <ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractAssert.extracting
(String propertyOrField, AssertFactory<Object, ASSERT> assertFactory) Extracts the value of given field/property from the object under test and creates a new assertion object using the given assert factory.protected <T,
ASSERT extends AbstractAssert<?, ?>>
ASSERTAbstractAssert.extracting
(Function<? super ACTUAL, ? extends T> extractor, AssertFactory<T, ASSERT> assertFactory) Uses the givenFunction
to extract a value from the object under test and creates a new assertion object using the given assert factory.AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.extracting
(String propertyOrField) Extract the values of the given field or property from the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> AbstractIterableAssert.extracting
(String... propertiesOrFields) Extract the values of the given fields/properties from the Iterable's elements under test into a new Iterable composed of Tuples (a simple data structure), this new Iterable becoming the Iterable under test.<P> AbstractListAssert
<?, List<? extends P>, P, ObjectAssert<P>> AbstractIterableAssert.extracting
(String propertyOrField, Class<P> extractingType) Extract the values of given field or property from the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.final AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> AbstractIterableAssert.extracting
(Function<? super ELEMENT, ?>... extractors) <V> AbstractListAssert
<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.extracting
(Function<? super ELEMENT, V> extractor) Extract the values from Iterable's elements under test by applying an extracting function on them.<V,
EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.extracting
(ThrowingExtractor<? super ELEMENT, V, EXCEPTION> extractor) Extract the values from Iterable's elements under test by applying an extracting function (which might throw an exception) on them.AbstractObjectAssert
<?, ?> AbstractMapAssert.extracting
(Object key) Deprecated.useAbstractMapAssert.extractingByKey(Object)
insteadAbstractMapAssert.extracting
(Object... keys) Deprecated.useAbstractMapAssert.extractingByKeys(Object[])
insteadAbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractObjectArrayAssert.extracting
(String fieldOrProperty) Extract the values of given field or property from the array's elements under test into a new list, this new list becoming the object under test.AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> AbstractObjectArrayAssert.extracting
(String... propertiesOrFields) Extract the values of given fields/properties from the array's elements under test into a list composed of Tuple (a simple data structure), this new list becoming the object under test.<P> AbstractListAssert
<?, List<? extends P>, P, ObjectAssert<P>> AbstractObjectArrayAssert.extracting
(String fieldOrProperty, Class<P> extractingType) Extract the values of given field or property from the array's elements under test into a new list, this new list of the provided type becoming the object under test.final AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> AbstractObjectArrayAssert.extracting
(Function<? super ELEMENT, ?>... extractors) <U> AbstractListAssert
<?, List<? extends U>, U, ObjectAssert<U>> AbstractObjectArrayAssert.extracting
(Function<? super ELEMENT, U> extractor) Extract the values from the array's elements by applying an extracting function on them, the resulting list becomes the new object under test.<V,
EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractObjectArrayAssert.extracting
(ThrowingExtractor<? super ELEMENT, V, EXCEPTION> extractor) Extract the values from the array's elements by applying an extracting function (which might throw an exception) on them, the resulting list of extracted values becomes a new object under test.AbstractObjectAssert
<?, ?> AbstractObjectAssert.extracting
(String propertyOrField) Extracts the value of given field/property from the object under test, the extracted value becoming the new object under test.AbstractObjectAssert.extracting
(String... propertiesOrFields) Extracts the values of given fields/properties from the object under test into a list, this new list becoming the object under test.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractObjectAssert.extracting
(String propertyOrField, InstanceOfAssertFactory<?, ASSERT> assertFactory) Extracts the value of given field/property from the object under test, the extracted value becoming the new object under test.final AbstractListAssert
<?, List<?>, Object, ObjectAssert<Object>> AbstractObjectAssert.extracting
(Function<? super ACTUAL, ?>... extractors) Uses the givenFunction
s to extract the values from the object under test into a list, this new list becoming the object under test.<T> AbstractObjectAssert
<?, T> AbstractObjectAssert.extracting
(Function<? super ACTUAL, T> extractor) Uses the givenFunction
to extract a value from the object under test, the extracted value becoming the new object under test.<T,
ASSERT extends AbstractAssert<?, ?>>
ASSERTAbstractObjectAssert.extracting
(Function<? super ACTUAL, T> extractor, InstanceOfAssertFactory<?, ASSERT> assertFactory) Uses the givenFunction
to extract a value from the object under test, the extracted value becoming the new object under test.AtomicReferenceArrayAssert.extracting
(String fieldOrProperty) Extract the values of given field or property from the array's elements under test into a new array, this new array becoming the array under test.AtomicReferenceArrayAssert.extracting
(String... propertiesOrFields) Extract the values of given fields/properties from the array's elements under test into a new array composed of Tuple (a simple data structure), this new array becoming the array under test.<P> ObjectArrayAssert
<P> AtomicReferenceArrayAssert.extracting
(String fieldOrProperty, Class<P> extractingType) Extract the values of given field or property from the array's elements under test into a new array, this new array becoming the array under test with type.<U> ObjectArrayAssert
<U> AtomicReferenceArrayAssert.extracting
(Function<? super T, U> extractor) Extract the values from the array's elements by applying an extracting function on them.<U,
EXCEPTION extends Exception>
ObjectArrayAssert<U> AtomicReferenceArrayAssert.extracting
(ThrowingExtractor<? super T, U, EXCEPTION> extractor) Extract the values from the array's elements by applying an extracting function (which might throw an exception) on them.AbstractMapAssert.extractingByKey
(K key) Extract the value of given key from the map under test, the extracted value becoming the new object under test.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractMapAssert.extractingByKey
(K key, InstanceOfAssertFactory<?, ASSERT> assertFactory) Extract the value of given key from the map under test, the extracted value becoming the new object under test.final AbstractListAssert
<?, List<? extends V>, V, ObjectAssert<V>> AbstractMapAssert.extractingByKeys
(K... keys) Extract the values of given keys from the map under test into an array, this new array becoming the object under test.final AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.extractingResultOf
(String method) Extract the result of given method invocation on the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.<P> AbstractListAssert
<?, List<? extends P>, P, ObjectAssert<P>> AbstractIterableAssert.extractingResultOf
(String method, Class<P> extractedType) Extract the result of given method invocation on the Iterable's elements under test into a new list of the given class, this new List becoming the object under test.AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractObjectArrayAssert.extractingResultOf
(String method) Extract the result of given method invocation from the array's elements under test into a list, this list becoming the object under test.<P> AbstractListAssert
<?, List<? extends P>, P, ObjectAssert<P>> AbstractObjectArrayAssert.extractingResultOf
(String method, Class<P> extractingType) Extract the result of given method invocation from the array's elements under test into a list, this list becoming the object under test.AtomicReferenceArrayAssert.extractingResultOf
(String method) Extract the result of given method invocation from the array's elements under test into a new array, this new array becoming the array under test.<P> ObjectArrayAssert
<P> AtomicReferenceArrayAssert.extractingResultOf
(String method, Class<P> extractingType) Extract the result of given method invocation from the array's elements under test into a new array, this new array becoming the array under test.AbstractIterableAssert.filteredOn
(String propertyOrFieldName, Object expectedValue) Filters the iterable under test keeping only elements having a property or field equal toexpectedValue
, the property/field is specified bypropertyOrFieldName
parameter.AbstractIterableAssert.filteredOn
(String propertyOrFieldName, FilterOperator<?> filterOperator) Filters the iterable under test keeping only elements having a property or field matching the filter expressed with theFilterOperator
, the property/field is specified bypropertyOrFieldName
parameter.<T> SELF
AbstractIterableAssert.filteredOn
(Function<? super ELEMENT, T> function, T expectedValue) Filters the iterable under test keeping only elements for which the result of thefunction
is equal toexpectedValue
.AbstractIterableAssert.filteredOn
(Condition<? super ELEMENT> condition) Filters the iterable under test keeping only elements matching the givenCondition
.AbstractObjectArrayAssert.filteredOn
(String propertyOrFieldName, Object expectedValue) Filter the array under test into a list composed of the elements elements having a property or field equal toexpectedValue
, the property/field is specified bypropertyOrFieldName
parameter.AbstractObjectArrayAssert.filteredOn
(String propertyOrFieldName, FilterOperator<?> filterOperator) Filter the array under test into a list composed of elements having a property or field matching the filter expressed with theFilterOperator
, the property/field is specified bypropertyOrFieldName
parameter.<T> SELF
AbstractObjectArrayAssert.filteredOn
(Function<? super ELEMENT, T> function, T expectedValue) Filter the array under test into a list composed of the elements for which the result of thefunction
is equal toexpectedValue
.AbstractObjectArrayAssert.filteredOn
(Condition<? super ELEMENT> condition) Filter the array under test into a list composed of the elements matching the givenCondition
, allowing to perform assertions on the filtered list.AtomicReferenceArrayAssert.filteredOn
(String propertyOrFieldName, Object expectedValue) Filter the array under test keeping only elements having a property or field equal toexpectedValue
, the property/field is specified bypropertyOrFieldName
parameter.AtomicReferenceArrayAssert.filteredOn
(String propertyOrFieldName, FilterOperator<?> filterOperator) Filter the array under test keeping only elements having a property or field matching the filter expressed with theFilterOperator
, the property/field is specified bypropertyOrFieldName
parameter.AtomicReferenceArrayAssert.filteredOn
(Function<? super T, U> function, U expectedValue) Filter the array under test into a list composed of the elements for which the result of thefunction
is equal toexpectedValue
.AtomicReferenceArrayAssert.filteredOn
(Condition<? super T> condition) Filter the array under test keeping only elements matching the givenCondition
.AbstractIterableAssert.filteredOnNull
(String propertyOrFieldName) Filters the iterable under test keeping only elements whose property or field specified bypropertyOrFieldName
is null.AbstractObjectArrayAssert.filteredOnNull
(String propertyOrFieldName) Filter the array under test into a list composed of the elements whose property or field specified bypropertyOrFieldName
are null.AtomicReferenceArrayAssert.filteredOnNull
(String propertyOrFieldName) Filter the array under test keeping only elements whose property or field specified bypropertyOrFieldName
is null.AbstractIterableAssert.first()
Navigate and allow to perform assertions on the first element of theIterable
under test.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractIterableAssert.first
(InstanceOfAssertFactory<?, ASSERT> assertFactory) Navigate and allow to perform assertions on the first element of theIterable
under test.AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.flatExtracting
(String fieldOrPropertyName) Extract Iterable's elements values corresponding to the given property/field name and concatenates them into a list becoming the new instance under test.AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.flatExtracting
(String... fieldOrPropertyNames) Extract the given property/field values from eachIterable
's element and flatten the extracted values in a list that is used as the new object under test.final AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.flatExtracting
(Function<? super ELEMENT, ?>... extractors) Extracts multiple values from eachIterable
's element according to the givenFunction
s and concatenates/flattens them in a list that becomes the instance under test.<V> AbstractListAssert
<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.flatExtracting
(Function<? super ELEMENT, ? extends Collection<V>> extractor) Extracts Iterable elements values by applying a function and concatenates the result into a list that becomes the instance under test.final <EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.flatExtracting
(ThrowingExtractor<? super ELEMENT, ?, EXCEPTION>... extractors) Extracts multiple values from eachIterable
's element according to the givenThrowingExtractor
s and concatenates/flattens them in a list that becomes the object under test.<V,
EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.flatExtracting
(ThrowingExtractor<? super ELEMENT, ? extends Collection<V>, EXCEPTION> extractor) Extracts Iterable elements values by applying a function (which might throw a checked exception) on them and concatenates/flattens the result into a single list that becomes the instance under test.AbstractMapAssert.flatExtracting
(String... keys) Flatten the values of the given keys from the actual map under test into a new array, this new array becoming the object under test.AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractObjectArrayAssert.flatExtracting
(String propertyName) Extract from array's elements the Iterable/Array values corresponding to the given property/field name and concatenate them into a single array becoming the new object under test.<V,
C extends Collection<V>>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractObjectArrayAssert.flatExtracting
(Function<? super ELEMENT, C> extractor) Extract the Iterable values from arrays elements under test by applying an Iterable extracting function on them and concatenating the result lists into an array which becomes the new object under test.<V,
C extends Collection<V>, EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractObjectArrayAssert.flatExtracting
(ThrowingExtractor<? super ELEMENT, C, EXCEPTION> extractor) Extract the Iterable values from arrays elements under test by applying an Iterable extracting function (which might throw an exception) on them and concatenating the result lists into an array which becomes the new object under test.AtomicReferenceArrayAssert.flatExtracting
(String propertyName) Extract from array's elements the Iterable/Array values corresponding to the given property/field name and concatenate them into a single array becoming the new object under test.<U,
C extends Collection<U>>
ObjectArrayAssert<U> AtomicReferenceArrayAssert.flatExtracting
(Function<? super T, C> extractor) Extract the Iterable values from the array's elements by applying an Iterable extracting function on them and concatenating the result lists into an array which becomes the new object under test.<U,
C extends Collection<U>, EXCEPTION extends Exception>
ObjectArrayAssert<U> AtomicReferenceArrayAssert.flatExtracting
(ThrowingExtractor<? super T, C, EXCEPTION> extractor) Extract the Iterable values from the array's elements by applying an Iterable extracting function (which might throw an exception) on them and concatenating the result lists into an array which becomes the new object under test.final AbstractListAssert
<?, List<? extends Object>, Object, ObjectAssert<Object>> Maps multiple values from eachIterable
's element according to the givenFunction
s and concatenates/flattens them in a list that becomes the instance under test.<V> AbstractListAssert
<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.flatMap
(Function<? super ELEMENT, ? extends Collection<V>> mapper) Maps the Iterable's elements under test by applying the givenFunction
and flattens the resulting collections in a list becoming the object under test.final <EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>> AbstractIterableAssert.flatMap
(ThrowingExtractor<? super ELEMENT, ?, EXCEPTION>... mappers) Maps multiple values from eachIterable
's element according to the givenThrowingExtractor
s and concatenates/flattens them in a list that becomes the object under test.<V,
EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.flatMap
(ThrowingExtractor<? super ELEMENT, ? extends Collection<V>, EXCEPTION> mapper) Maps the Iterable's elements under test by applying a mapping function (which might throw a checked exception) and concatenates/flattens the result into a single list that becomes the instance under test.<U> AbstractOptionalAssert
<?, U> CallflatMap
on theOptional
under test, assertions chained afterwards are performed on theOptional
resulting from the flatMap call.AbstractOptionalAssert.get()
Verifies that the actualOptional
is notnull
and not empty and returns an Object assertion that allows chaining (object) assertions on the optional value.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractOptionalAssert.get
(InstanceOfAssertFactory<?, ASSERT> assertFactory) Verifies that the actualOptional
is notnull
and not empty and returns an new assertion instance to chain assertions on the optional value.RecursiveComparisonAssert.ignoringActualEmptyOptionalFields()
Makes the recursive comparison to ignore all actual empty optional fields (includingOptional
,OptionalInt
,OptionalLong
andOptionalDouble
), note that the expected object empty optional fields are not ignored, this only applies to actual's fields.RecursiveComparisonAssert.ignoringActualNullFields()
Makes the recursive comparison to ignore all actual null fields (but note that the expected object null fields are used in the comparison).RecursiveComparisonAssert.ignoringCollectionOrder()
Makes the recursive comparison to ignore collection order in all fields in the object under test.RecursiveComparisonAssert.ignoringCollectionOrderInFields
(String... fieldsToIgnoreCollectionOrder) Makes the recursive comparison to ignore collection order in the object under test specified fields.RecursiveComparisonAssert.ignoringCollectionOrderInFieldsMatchingRegexes
(String... regexes) Makes the recursive comparison to ignore collection order in the object under test fields matching the specified regexes.RecursiveComparisonAssert.ignoringExpectedNullFields()
Makes the recursive comparison to ignore all expected null fields.RecursiveComparisonAssert.ignoringFields
(String... fieldNamesToIgnore) Makes the recursive comparison to ignore the given object under test fields.RecursiveComparisonAssert.ignoringFieldsMatchingRegexes
(String... regexes) Makes the recursive comparison to ignore the object under test fields whose name matches the given regexes.RecursiveComparisonAssert.ignoringOverriddenEqualsForFields
(String... fields) In case you have instructed the recursive to use overriddenequals
withRecursiveComparisonAssert.usingOverriddenEquals()
, this method allows to ignore overriddenequals
for the given fields (it adds them to the already registered ones).RecursiveComparisonAssert.ignoringOverriddenEqualsForFieldsMatchingRegexes
(String... regexes) In case you have instructed the recursive comparison to use overriddenequals
withRecursiveComparisonAssert.usingOverriddenEquals()
, this method allows to force a recursive comparison for the fields matching the given regexes (it adds them to the already registered ones).RecursiveComparisonAssert.ignoringOverriddenEqualsForTypes
(Class<?>... types) By default, the recursive comparison uses overriddenequals
methods to compare fields, this method allows to force a recursive comparison for all fields of the given types (it adds them to the already registered ones).protected SELF
AbstractAssert.inBinary()
Use binary object representation instead of standard representation in error messages.AbstractComparableAssert.inBinary()
AbstractEnumerableAssert.inBinary()
AbstractIterableAssert.inBinary()
Enable binary representation of Iterable elements instead of standard representation in error messages.AbstractObjectArrayAssert.inBinary()
AbstractUniversalComparableAssert.inBinary()
Use binary object representation instead of standard representation in error messages.AtomicReferenceArrayAssert.inBinary()
protected SELF
AbstractAssert.inHexadecimal()
Use hexadecimal object representation instead of standard representation in error messages.AbstractCharSequenceAssert.inHexadecimal()
AbstractComparableAssert.inHexadecimal()
AbstractEnumerableAssert.inHexadecimal()
Enable hexadecimal object representation of Iterable elements instead of standard java representation in error messages.AbstractIterableAssert.inHexadecimal()
Enable hexadecimal representation of Iterable elements instead of standard representation in error messages.AbstractObjectArrayAssert.inHexadecimal()
Enable hexadecimal object representation of Iterable elements instead of standard java representation in error messages.AbstractUniversalComparableAssert.inHexadecimal()
Use hexadecimal object representation instead of standard representation in error messages.AtomicReferenceArrayAssert.inHexadecimal()
Enable hexadecimal object representation of Iterable elements instead of standard java representation in error messages.AbstractCharacterAssert.inUnicode()
Use unicode character representation instead of standard representation in error messages.AbstractCharArrayAssert.inUnicode()
Use unicode character representation instead of standard representation in error messages.AbstractCharSequenceAssert.inUnicode()
Use unicode character representation instead of standard representation in error messages.Char2DArrayAssert.inUnicode()
Use unicode character representation instead of standard representation in error messages.AbstractIterableAssert.last()
Navigate and allow to perform assertions on the last element of theIterable
under test.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractIterableAssert.last
(InstanceOfAssertFactory<?, ASSERT> assertFactory) Navigate and allow to perform assertions on the last element of theIterable
under test.final AbstractListAssert
<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> <V,
EXCEPTION extends Exception>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> AbstractIterableAssert.map
(ThrowingExtractor<? super ELEMENT, V, EXCEPTION> mapper) Maps the Iterable's elements by applying the given mapping function (which might throw an exception), the returned list becomes the instance under test.<U> AbstractOptionalAssert
<?, U> Callmap
on theOptional
under test, assertions chained afterwards are performed on theOptional
resulting from the map call.AbstractAssert.overridingErrorMessage
(String newErrorMessage, Object... args) Overrides AssertJ default error message by the given one.AbstractAssert.overridingErrorMessage
(Supplier<String> supplier) Overrides AssertJ default error message by the given one.AbstractIterableAssert.overridingErrorMessage
(String newErrorMessage, Object... args) AbstractListAssert.overridingErrorMessage
(String newErrorMessage, Object... args) AbstractMapAssert.overridingErrorMessage
(String newErrorMessage, Object... args) FileSizeAssert.returnToFile()
AbstractIterableAssert
<IterableAssert<T>, Iterable<? extends T>, T, ObjectAssert<T>> IterableSizeAssert.returnToIterable()
MapSizeAssert.returnToMap()
AbstractIterableAssert.singleElement()
Verifies that theIterable
under test contains a single element and allows to perform assertions on that element.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractIterableAssert.singleElement
(InstanceOfAssertFactory<?, ASSERT> assertFactory) Verifies that theIterable
under test contains a single element and allows to perform assertions on that element, the assertions are strongly typed according to the givenAssertFactory
parameter.AbstractObjectArrayAssert.singleElement()
Verifies that the array under test contains a single element and allows to perform assertions on that element.<ASSERT extends AbstractAssert<?,
?>>
ASSERTAbstractObjectArrayAssert.singleElement
(InstanceOfAssertFactory<?, ASSERT> assertFactory) Verifies that the array under test contains a single element and allows to perform assertions on that element, the assertions are strongly typed according to the givenAssertFactory
parameter.AbstractFileAssert.size()
Returns anAssert
object that allows performing assertions on the size of theFile
under test.AbstractIterableAssert.size()
Returns anAssert
object that allows performing assertions on the size of theIterable
under test.AbstractMapAssert.size()
Returns anAssert
object that allows performing assertions on the size of theMap
under test.default MatcherAssert
Create assertion forMatcher
.AbstractFileAssert.usingCharset
(String charsetName) Specifies the name of the charset to use for text-based assertions on the file's contents.AbstractFileAssert.usingCharset
(Charset charset) Specifies the charset to use for text-based assertions on the file's contents.AbstractPathAssert.usingCharset
(String charsetName) Specifies the name of the charset to use for text-based assertions on the path's contents (path must be a readable file).AbstractPathAssert.usingCharset
(Charset charset) Specifies the charset to use for text-based assertions on the path's contents (path must be a readable file).AbstractAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AbstractAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AbstractBigDecimalAssert.usingComparator
(Comparator<? super BigDecimal> customComparator) AbstractBigDecimalAssert.usingComparator
(Comparator<? super BigDecimal> customComparator, String customComparatorDescription) AbstractBigIntegerAssert.usingComparator
(Comparator<? super BigInteger> customComparator) AbstractBigIntegerAssert.usingComparator
(Comparator<? super BigInteger> customComparator, String customComparatorDescription) AbstractByteAssert.usingComparator
(Comparator<? super Byte> customComparator) AbstractByteAssert.usingComparator
(Comparator<? super Byte> customComparator, String customComparatorDescription) AbstractCharacterAssert.usingComparator
(Comparator<? super Character> customComparator) AbstractCharacterAssert.usingComparator
(Comparator<? super Character> customComparator, String customComparatorDescription) AbstractCharSequenceAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) AbstractCharSequenceAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) AbstractComparableAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) AbstractComparableAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) AbstractDateAssert.usingComparator
(Comparator<? super Date> customComparator) AbstractDateAssert.usingComparator
(Comparator<? super Date> customComparator, String customComparatorDescription) AbstractDoubleAssert.usingComparator
(Comparator<? super Double> customComparator) AbstractDoubleAssert.usingComparator
(Comparator<? super Double> customComparator, String customComparatorDescription) AbstractFloatAssert.usingComparator
(Comparator<? super Float> customComparator) AbstractFloatAssert.usingComparator
(Comparator<? super Float> customComparator, String customComparatorDescription) AbstractIntegerAssert.usingComparator
(Comparator<? super Integer> customComparator) AbstractIntegerAssert.usingComparator
(Comparator<? super Integer> customComparator, String customComparatorDescription) AbstractIterableAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) AbstractIterableAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) AbstractListAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) AbstractListAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) AbstractLongAdderAssert.usingComparator
(Comparator<? super LongAdder> customComparator) AbstractLongAdderAssert.usingComparator
(Comparator<? super LongAdder> customComparator, String customComparatorDescription) AbstractLongAssert.usingComparator
(Comparator<? super Long> customComparator) AbstractLongAssert.usingComparator
(Comparator<? super Long> customComparator, String customComparatorDescription) AbstractMapAssert.usingComparator
(Comparator<? super ACTUAL> customComparator) AbstractMapAssert.usingComparator
(Comparator<? super ACTUAL> customComparator, String customComparatorDescription) AbstractShortAssert.usingComparator
(Comparator<? super Short> customComparator) AbstractShortAssert.usingComparator
(Comparator<? super Short> customComparator, String customComparatorDescription) AbstractStringAssert.usingComparator
(Comparator<? super String> customComparator) Use the given custom comparator instead of relying onString
natural comparator for the incoming assertions.AbstractStringAssert.usingComparator
(Comparator<? super String> customComparator, String customComparatorDescription) Use the given custom comparator instead of relying onString
natural comparator for the incoming assertions.AbstractTemporalAssert.usingComparator
(Comparator<? super TEMPORAL> customComparator) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AbstractTemporalAssert.usingComparator
(Comparator<? super TEMPORAL> customComparator, String customComparatorDescription) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AbstractUniversalComparableAssert.usingComparator
(Comparator<? super Comparable<T>> customComparator) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AbstractUniversalComparableAssert.usingComparator
(Comparator<? super Comparable<T>> customComparator, String customComparatorDescription) Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.AtomicIntegerAssert.usingComparator
(Comparator<? super AtomicInteger> customComparator) AtomicIntegerAssert.usingComparator
(Comparator<? super AtomicInteger> customComparator, String customComparatorDescription) AtomicLongAssert.usingComparator
(Comparator<? super AtomicLong> customComparator) AtomicLongAssert.usingComparator
(Comparator<? super AtomicLong> customComparator, String customComparatorDescription) <T> SELF
AbstractIterableAssert.usingComparatorForElementFieldsWithNames
(Comparator<T> comparator, String... elementPropertyOrFieldNames) Deprecated.This method is used withAbstractIterableAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAbstractIterableAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractIterableAssert.usingRecursiveComparison()
.<C> SELF
AbstractObjectArrayAssert.usingComparatorForElementFieldsWithNames
(Comparator<C> comparator, String... elementPropertyOrFieldNames) Deprecated.This method is used withAbstractObjectArrayAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAbstractObjectArrayAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractObjectArrayAssert.usingRecursiveComparison()
.AtomicReferenceArrayAssert.usingComparatorForElementFieldsWithNames
(Comparator<C> comparator, String... elementPropertyOrFieldNames) Deprecated.This method is used withAtomicReferenceArrayAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAtomicReferenceArrayAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractAssert.usingRecursiveComparison()
.<T> SELF
AbstractIterableAssert.usingComparatorForElementFieldsWithType
(Comparator<T> comparator, Class<T> type) Deprecated.This method is used withAbstractIterableAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAbstractIterableAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractIterableAssert.usingRecursiveComparison()
.<C> SELF
AbstractObjectArrayAssert.usingComparatorForElementFieldsWithType
(Comparator<C> comparator, Class<C> type) Deprecated.This method is used withAbstractObjectArrayAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAbstractObjectArrayAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractObjectArrayAssert.usingRecursiveComparison()
.AtomicReferenceArrayAssert.usingComparatorForElementFieldsWithType
(Comparator<C> comparator, Class<C> type) Deprecated.This method is used withAtomicReferenceArrayAssert.usingFieldByFieldElementComparator()
which is deprecated in favor ofAtomicReferenceArrayAssert.usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
orAbstractAssert.usingRecursiveComparison()
.<T> SELF
AbstractObjectAssert.usingComparatorForFields
(Comparator<T> comparator, String... propertiesOrFields) Allows to set a specific comparator to compare properties or fields with the given names.<T> SELF
AbstractIterableAssert.usingComparatorForType
(Comparator<T> comparator, Class<T> type) Allows to set a specific comparator for the given type of elements or their fields.<C> SELF
AbstractObjectArrayAssert.usingComparatorForType
(Comparator<C> comparator, Class<C> type) Allows to set a specific comparator for the given type of elements or their fields.<T> SELF
AbstractObjectAssert.usingComparatorForType
(Comparator<? super T> comparator, Class<T> type) Allows to set a specific comparator to compare properties or fields with the given type.AtomicReferenceArrayAssert.usingComparatorForType
(Comparator<C> comparator, Class<C> type) Allows to set a specific comparator for the given type of elements or their fields.AbstractDoubleArrayAssert.usingComparatorWithPrecision
(Double precision) Create aDouble
comparator which compares double at the given precision and pass it toAbstractDoubleArrayAssert.usingElementComparator(Comparator)
.AbstractFloatArrayAssert.usingComparatorWithPrecision
(Float precision) Create aFloat
comparator which compares floats at the given precision and pass it toAbstractFloatArrayAssert.usingElementComparator(Comparator)
.AbstractAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AbstractBigDecimalAssert.usingDefaultComparator()
AbstractBigIntegerAssert.usingDefaultComparator()
AbstractByteAssert.usingDefaultComparator()
AbstractCharacterAssert.usingDefaultComparator()
AbstractCharSequenceAssert.usingDefaultComparator()
AbstractComparableAssert.usingDefaultComparator()
AbstractDateAssert.usingDefaultComparator()
AbstractDoubleAssert.usingDefaultComparator()
AbstractFloatAssert.usingDefaultComparator()
AbstractIntegerAssert.usingDefaultComparator()
AbstractIterableAssert.usingDefaultComparator()
AbstractListAssert.usingDefaultComparator()
AbstractLocalDateTimeAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AbstractLongAdderAssert.usingDefaultComparator()
AbstractLongAssert.usingDefaultComparator()
AbstractMapAssert.usingDefaultComparator()
AbstractOffsetDateTimeAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AbstractShortAssert.usingDefaultComparator()
AbstractStringAssert.usingDefaultComparator()
AbstractTemporalAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AbstractUniversalComparableAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AbstractZonedDateTimeAssert.usingDefaultComparator()
Revert to standard comparison for the incoming assertion checks.AtomicIntegerAssert.usingDefaultComparator()
AtomicLongAssert.usingDefaultComparator()
AbstractByteArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractCharArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractDoubleArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractFloatArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractIntArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractIterableAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractListAssert.usingDefaultElementComparator()
AbstractLongArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractObjectArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractShortArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AtomicIntegerArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AtomicReferenceArrayAssert.usingDefaultElementComparator()
Revert to standard comparison for incoming assertion group element checks.AbstractOptionalAssert.usingDefaultValueComparator()
Revert to standard comparison for incoming assertionOptional
value checks.AbstractByteArrayAssert.usingElementComparator
(Comparator<? super Byte> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractCharArrayAssert.usingElementComparator
(Comparator<? super Character> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractDoubleArrayAssert.usingElementComparator
(Comparator<? super Double> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractFloatArrayAssert.usingElementComparator
(Comparator<? super Float> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractIntArrayAssert.usingElementComparator
(Comparator<? super Integer> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractIterableAssert.usingElementComparator
(Comparator<? super ELEMENT> elementComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractListAssert.usingElementComparator
(Comparator<? super ELEMENT> customComparator) AbstractLongArrayAssert.usingElementComparator
(Comparator<? super Long> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractObjectArrayAssert.usingElementComparator
(Comparator<? super ELEMENT> elementComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AbstractShortArrayAssert.usingElementComparator
(Comparator<? super Short> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare group elements for incoming assertion checks.AtomicIntegerArrayAssert.usingElementComparator
(Comparator<? super Integer> customComparator) Use given custom comparator instead of relying on Integerequals
method to compare elements for incoming assertion checks.AtomicLongArrayAssert.usingElementComparator
(Comparator<? super Long> customComparator) Use given custom comparator instead of relying on Longequals
method to compare elements for incoming assertion checks.AtomicReferenceArrayAssert.usingElementComparator
(Comparator<? super T> elementComparator) Use given custom comparator instead of relying on actual element typeequals
method to compare AtomicReferenceArray elements for incoming assertion checks.AbstractIterableAssert.usingElementComparatorIgnoringFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractObjectArrayAssert.usingElementComparatorIgnoringFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AtomicReferenceArrayAssert.usingElementComparatorIgnoringFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractIterableAssert.usingElementComparatorOnFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractObjectArrayAssert.usingElementComparatorOnFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AtomicReferenceArrayAssert.usingElementComparatorOnFields
(String... fields) Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.private SELF
AbstractIterableAssert.usingExtendedByTypesElementComparator
(Comparator<Object> elementComparator) AbstractIterableAssert.usingFieldByFieldElementComparator()
Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractObjectArrayAssert.usingFieldByFieldElementComparator()
Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AtomicReferenceArrayAssert.usingFieldByFieldElementComparator()
Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractOptionalAssert.usingFieldByFieldValueComparator()
Deprecated.This method is deprecated because it performs a shallow field by field comparison, i.e.AbstractIterableAssert.usingRecursiveFieldByFieldElementComparator()
Enable using a recursive field by field comparison strategy similar toAbstractIterableAssert.usingRecursiveComparison()
but contrary to the latter you can chain any iterable assertions after this method (this is why this method exists).AbstractObjectArrayAssert.usingRecursiveFieldByFieldElementComparator()
Enable using a recursive field by field comparison strategy similar toAbstractObjectArrayAssert.usingRecursiveComparison()
but contrary to the latter you can chain any iterable assertions after this method (this is why this method exists).AtomicReferenceArrayAssert.usingRecursiveFieldByFieldElementComparator()
Enable using a recursive field by field comparison strategy similar toAbstractAssert.usingRecursiveComparison()
but contrary to the latter you can chain any iterable assertions after this method (this is why this method exists).AbstractIterableAssert.usingRecursiveFieldByFieldElementComparatorIgnoringFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on all fields (including inherited fields) except the given ones instead of relying on the elementequals
method.AbstractObjectArrayAssert.usingRecursiveFieldByFieldElementComparatorIgnoringFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on all fields (including inherited fields) except the given ones instead of relying on the elementequals
method.AtomicReferenceArrayAssert.usingRecursiveFieldByFieldElementComparatorIgnoringFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on all fields (including inherited fields) except the given ones instead of relying on the elementequals
method.AbstractIterableAssert.usingRecursiveFieldByFieldElementComparatorOnFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on the given fields (including inherited fields) instead of relying on the elementequals
method.AbstractObjectArrayAssert.usingRecursiveFieldByFieldElementComparatorOnFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on the given fields (including inherited fields) instead of relying on the elementequals
method.AtomicReferenceArrayAssert.usingRecursiveFieldByFieldElementComparatorOnFields
(String... fields) The assertions chained after this method will use a recursive field by field comparison on the given fields (including inherited fields) instead of relying on the elementequals
method.AbstractOptionalAssert.usingValueComparator
(Comparator<? super VALUE> customComparator) Use given custom comparator instead of relying on actual type Aequals
method to compare theOptional
value's object for incoming assertion checks.RecursiveComparisonAssert.withComparatorForFields
(Comparator<?> comparator, String... fieldLocations) Allows to register a comparator to compare fields with the given locations.<T> SELF
RecursiveComparisonAssert.withComparatorForType
(Comparator<? super T> comparator, Class<T> type) Allows to register a comparator to compare the fields with the given type.AbstractDateAssert.withDateFormat
(String userCustomDateFormatPattern) Instead of using default date formats for the date String based Date assertions likeAbstractDateAssert.isEqualTo(String)
, AssertJ is gonna use any date formats registered with one of these methods : this methodAbstractDateAssert.withDateFormat(java.text.DateFormat)
AbstractDateAssert.registerCustomDateFormat(java.text.DateFormat)
AbstractDateAssert.registerCustomDateFormat(String)
AbstractDateAssert.withDateFormat
(DateFormat userCustomDateFormat) Instead of using default date formats for the date String based Date assertions likeAbstractDateAssert.isEqualTo(String)
, AssertJ is gonna use any date formats registered with one of these methods :AbstractDateAssert.withDateFormat(String)
this methodAbstractDateAssert.registerCustomDateFormat(java.text.DateFormat)
AbstractDateAssert.registerCustomDateFormat(String)
AbstractDateAssert.withDefaultDateFormatsOnly()
Remove all registered custom date formats => use only the defaults date formats to parse string as date.RecursiveComparisonAssert.withEqualsForFields
(BiPredicate<?, ?> equals, String... fieldLocations) Allows to register aBiPredicate
to compare fields with the given locations.<T> SELF
RecursiveComparisonAssert.withEqualsForType
(BiPredicate<? super T, ? super T> equals, Class<T> type) Allows to register aBiPredicate
to compare the fields with the given type.RecursiveComparisonAssert.withErrorMessageForFields
(String message, String... fieldLocations) Overrides an error message which would be shown when differences in the given fields while comparison occurred with the giving error message.RecursiveComparisonAssert.withErrorMessageForType
(String message, Class<?> type) Overrides an error message which would be shown when differences for the giving type while comparison occurred with the giving error message.AbstractAssert.withFailMessage
(String newErrorMessage, Object... args) Alternative method forAbstractAssert.overridingErrorMessage(java.lang.String, java.lang.Object...)
AbstractAssert.withFailMessage
(Supplier<String> supplier) Alternative method forAbstractAssert.overridingErrorMessage(java.lang.String, java.lang.Object...)
AbstractIterableAssert.withFailMessage
(String newErrorMessage, Object... args) AbstractListAssert.withFailMessage
(String newErrorMessage, Object... args) AbstractMapAssert.withFailMessage
(String newErrorMessage, Object... args) RecursiveComparisonAssert.withIntrospectionStrategy
(RecursiveComparisonIntrospectionStrategy introspectionStrategy) Defines how objects are introspected in the recursive comparison, that is: how to traverse the graph of nodes to compare how to get a node valueAbstractAssert.withRepresentation
(Representation representation) Use the givenRepresentation
to describe/represent values in AssertJ error messages.RecursiveComparisonAssert.withStrictTypeChecking()
Makes the recursive comparison to check that actual's type is compatible with expected's type (and do the same for each field).AbstractAssert.withThreadDumpOnError()
In case of an assertion error, a thread dump will be printed toSystem.err
.AbstractIterableAssert.withThreadDumpOnError()
AbstractListAssert.withThreadDumpOnError()
AbstractMapAssert.withThreadDumpOnError()
WithThrowable.withThrowableThat()
Returns aThrowableAssertAlternative
to chain assertions on the underlying throwable.