For example:
int removed = employees.removeFired();
assertThat(removed).isZero();
List<Employee> newEmployees = employees.hired(TODAY);
assertThat(newEmployees).hasSize(6);
This class only contains all assertThat methods, if you have ambiguous method compilation error, use either AssertionsForClassTypes or AssertionsForInterfaceTypes
and if you need both, fully qualify you assertThat method.
Java 8 is picky when choosing the right assertThat 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 proper assertThat method (normally assertThat(Throwable) as foo might implement an interface like List,
if that occurred assertThat(List) would also be a possible choice - thus confusing java 8.
This why Assertions have been split in AssertionsForClassTypes and AssertionsForInterfaceTypes
(see http://stackoverflow.com/questions/29499847/ambiguous-method-in-java-8-why).
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of object the given condition accept. T> Condition | |
| public static < the type of object the given condition accept. T> Condition | |
| public static < the type of object the given consumers accept T> ThrowingConsumer | Returns: theThrowingConsumer instancethe consumers to evaluate consumers)Create a new |
| public static < the type of object the given condition accept. T> Condition | Returns: the createdAnyOf.the conditions to evaluate. conditions)Only delegate to |
| public static < the type of object the given condition accept. T> Condition | |
| public static < the type of object the given consumers accept T> ThrowingConsumer | Returns: theThrowingConsumer instancethe consumers to evaluate consumers)Create a new |
| public static < the type to use for the cast. T, the type of the resulting ASSERT extends AbstractAssertAssert | Returns: same instance ofassertFactorythe factory which verifies the type and creates the new assertFactory)AssertA syntax sugar to write fluent assertion with methods having an |
| public static < the type of the value contained in the T> PredicateAssertPredicate. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static IntPredicateAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static LongPredicateAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static DoublePredicateAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the RESULT> CompletableFutureAssertjava.. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the RESULT> CompletableFutureAssertjava.. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the VALUE> OptionalAssertjava.. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static OptionalDoubleAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static OptionalIntAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static OptionalLongAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static MatcherAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AbstractBigDecimalAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractBigIntegerAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractUriAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractUrlAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractBooleanAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractBooleanAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractBooleanArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Boolean2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractByteAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractByteAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractByteArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Byte2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractCharacterAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractCharArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Char2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractCharacterAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static ClassAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractDoubleAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractDoubleAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractDoubleArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Double2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractFileAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of the value contained in the RESULT> FutureAssertjava.. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AbstractInputStreamAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractFloatAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractFloatAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractFloatArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractIntegerAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractIntArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Int2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Float2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractIntegerAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < The actual type ACTUAL extends IterableThe actual elements type ELEMENT, The actual elements AbstractAssert type ELEMENT_ASSERT extends AbstractAssert | Returns: the created assertion object.the actual value. actual, AssertFactory<ELEMENT, ELEMENT_ASSERT> the factory used to create the elements assert instance. assertFactory)
Deprecated
This was added to help creating type-specific assertions for the elements of an
Creates a new instance of Iterable instance.
allowing to navigate to any Iterable element
in order to perform assertions on it.
|
| public static < The actual type ACTUAL extends IterableThe actual elements type ELEMENT, The actual elements AbstractAssert type ELEMENT_ASSERT extends AbstractAssert | Returns: the created assertion object.the actual value. actual, Class<ELEMENT_ASSERT> the class used to create the elements assert instance. assertClass)
Deprecated
This was added to help creating type-specific assertions for the elements of an
Creates a new instance of Iterable instance.
allowing to navigate to any Iterable element
in order to perform assertions on it.
|
| public static < The actual type ACTUAL extends ListThe actual elements type ELEMENT, The actual elements AbstractAssert type ELEMENT_ASSERT extends AbstractAssert | Returns: the created assertion object.the actual value. actual, AssertFactory<ELEMENT, ELEMENT_ASSERT> the factory used to create the elements assert instance. assertFactory)
Deprecated
This was added to help creating type-specific assertions for the elements of an
Creates a new instance of List instance.
allowing to navigate to any List element
in order to perform assertions on it.
|
| public static < The actual elements type ELEMENT, The actual type ACTUAL extends ListThe actual elements AbstractAssert type ELEMENT_ASSERT extends AbstractAssert | Returns: the created assertion object.the actual value. actual, Class<ELEMENT_ASSERT> the class used to create the elements assert instance. assertClass)
Deprecated
This was added to help creating type-specific assertions for the elements of an
Creates a new instance of List instance.
allowing to navigate to any List element
in order to perform assertions on it.
|
| public static AbstractLongAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractLongAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractLongArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Long2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of the actual value. T> ObjectAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual's elements type. T> ObjectArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual's elements type. T> Object2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractShortAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractShortAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractShortArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static Short2DArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractDateAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractZonedDateTimeAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static TemporalAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractLocalDateTimeAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractOffsetDateTimeAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractOffsetTimeAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AbstractLocalTimeAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractLocalDateAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractYearMonthAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractInstantAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractDurationAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractPeriodAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AtomicBooleanAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AtomicIntegerAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AtomicIntegerArrayAssert | Returns: the created assertion object.the actual value. actual)Create int[] assertion for |
| public static < the type of the object holding the updatable field. OBJECT> AtomicIntegerFieldUpdaterAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static LongAdderAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AtomicLongAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static AtomicLongArrayAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the object holding the updatable field. OBJECT> AtomicLongFieldUpdaterAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the VALUE> AtomicReferenceAssertAtomicReference. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the ELEMENT> AtomicReferenceArrayAssertAtomicReferenceArray. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the field which gets updated by the FIELD, AtomicReferenceFieldUpdater.the type of the object holding the updatable field. OBJECT> AtomicReferenceFieldUpdaterAssert | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the VALUE> AtomicMarkableReferenceAssertAtomicMarkableReference. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the value contained in the VALUE> AtomicStampedReferenceAssertAtomicStampedReference. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static < the type of the actual throwable. T extends Throwable> AbstractThrowableAssert | Returns: the createdThrowableAssert.the actual value. actual)Creates a new instance of |
| public static < the AssertProvider wrapped type. T> T | Returns: the associatedAssert of the given componentthe component that creates its own assert component)Delegates the creation of the |
| public static AbstractCharSequenceAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractCharSequenceAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractCharSequenceAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractStringAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> IterableAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> IteratorAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. E> AbstractCollectionAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> ListAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> ListAssert | Returns: the created assertion object.the actual actual)Stream value.Creates a new instance of |
| public static ListAssert | Returns: the created assertion object.the actual actual)DoubleStream value.Creates a new instance of |
| public static ListAssert | Returns: the created assertion object.the actual actual)LongStream value.Creates a new instance of |
| public static ListAssert | Returns: the created assertion object.the actual actual)IntStream value.Creates a new instance of |
| public static < the type of elements. ELEMENT> SpliteratorAssert | Returns: the created assertion object.the spliterator to test. actual)Creates a new instance of |
| public static AbstractPathAssert | Returns: the created assertion objectthe path to test actual)Creates a new instance of |
| public static < the type of keys in the map. K, the type of values in the map. V> MapAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of actual. T extends Comparable | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the generic type of the user-defined assert. T extends AssertDelegateTarget> T | Returns: the given assertion.the assertion to return. assertion)Returns the given assertion. |
| public static AbstractCharSequenceAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractThrowableAssert | Returns: the createdThrowableAssert.The shouldRaiseOrNotThrowableThrowingCallable or lambda with the code that should raise the throwable.Allows to capture and then assert on a |
| public static < the type of elements. E> AbstractCollectionAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of actual. T> AbstractUniversalComparableAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static < the exception type. T extends Throwable> ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.the exception type class. exceptionType)Entry point to check that an exception of type T is thrown by a given |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static < the type of elements. ELEMENT> IterableAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> IteratorAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. ELEMENT> ListAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static NotThrownAssert | Returns: the createdNotThrownAssert.Entry point to check that no exception of any type is thrown by a given |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static < the type of the actual value. T> ObjectAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractPathAssert | Returns: the created assertion objectthe path to test actual)Creates a new instance of
Use this over |
| public static < the type of the value contained in the T> PredicateAssertPredicate. | Returns: the created assertion object.the actual value. actual)Create assertion for |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.Alias for |
| public static < the type of elements. ELEMENT> ListAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractThrowableAssert | Returns: the createdThrowableAssert.The shouldRaiseThrowableThrowingCallable or lambda with the code that should raise the throwable.Allows to capture and then assert on a |
| public static AbstractThrowableAssert | Returns: the createdThrowableAssert.The shouldRaiseThrowable,ThrowingCallable or lambda with the code that should raise the throwable.the new description to set. description, Object... optional parameter if description is a format String. args)Allows to capture and then assert on a |
| public static < the type of the actual value. T> ObjectAssert | Returns: the created assertion object.the actual value. actual, Consumer<T>... to assert on the actual object - must not be null. requirements)Uses the given instance as the instance under test for all the assertions expressed as the passed |
| public static Index | Returns: the createdIndex.the value of the index. index)Only delegate to |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Build a |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Alias for |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for BigDecimal |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for BigInteger |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for Byte |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for Long |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for Short |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for Long |
| public static TemporalUnitOffset | Returns: the createdOffset.the value of the offset. value, TemporalUnit the unit)TemporalUnit of the offset.Assertions entry point for |
| public static Exception | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static IllegalArgumentException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static IllegalStateException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static IndexOutOfBoundsException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static IOException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static NullPointerException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static ReflectiveOperationException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static RuntimeException | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. throwingCallableAllows catching an instance of |
| public static Throwable | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. shouldRaiseThrowableAllows catching a |
| public static < the THROWABLE extends Throwable> THROWABLEThrowable type. | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. shouldRaiseThrowable,The type of exception that the code is expected to raise. type)
Deprecated
use
Allows catching a catchThrowableOfType(Class, ThrowingCallable) instead.
Throwable of a specific type.
|
| public static < the THROWABLE extends Throwable> THROWABLEThrowable type. | Returns: The captured exception ornull if none was raised by the callable.The type of exception that the code is expected to raise. type, ThrowableAssert.The lambda with the code that should raise the exception. shouldRaiseThrowableAllows catching a |
| public static String | Returns: the content of the file.the file. file, Charset the character set to use. charset)Loads the text content of a file, so that it can be passed to |
| public static String | Returns: the content of the file.the file. file, String the name of the character set to use. charsetName)Loads the text content of a file, so that it can be passed to |
| public static String | Returns: the content of the file.the file. file)Loads the text content of a file with the default character set, so that it can be passed to
|
| public static String | Returns: the content of the URL.the URL. url, Charset the character set to use. charset)Loads the text content of a URL, so that it can be passed to |
| public static String | Returns: the content of the URL.the URL. url, String the name of the character set to use. charsetName)Loads the text content of a URL, so that it can be passed to |
| public static String | Returns: the content of the file.the URL. url)Loads the text content of a URL with the default character set, so that it can be passed to
|
| public static < the type of object the given condition accept. T> DoesNotHave | Returns: The DoesNotHave condition created.the condition to inverse. condition)Creates a new |
| public static < the type of keys in the map. K, the type of values in the map. V> MapEntry | Returns: the createdMapEntry.the key of the entry to create. key, V the value of the entry to create. value)Only delegate to |
| public static < the type of value to extract. T> Properties | Returns: the createdProperties.the name of the property to be read from the elements of a propertyName, Class<T> Iterable. It may be a nested
property (e.g. "address.street.number").the type of property to extract propertyType)Only delegate to |
| public static Properties | Returns: the createdProperties.the name of the property to be read from the elements of a propertyName)Iterable. It may be a nested
property (e.g. "address.street.number").Only delegate to |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> fail("boom")));.error message. failureMessage)Throws an |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> fail()));.Throws an
|
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> fail("b%s", "oom")));.error message. failureMessage, Object... Arguments referenced by the format specifiers in the format string. args)Throws an |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> fail("boom", cause)));.the description of the failed assertion. It can be failureMessage, Throwable null.cause of the error. realCause)Throws an |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> fail(cause)));.cause of the error. realCause)Throws an |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> failBecauseExceptionWasNotThrown(IOException.class)));.the Throwable class that was expected to be thrown. throwableClass)Throws an |
| public static < the array elements type. E> Filters | Returns: the created.the array to filter. array)Only delegate to |
| public static < the E> FiltersIterable elements type. | Returns: the created.the iterableToFilter)Iterable to filter.Only delegate to |
| public static < Type of test subject F, Type of the property under the assertion T> Function | Returns: same instance ofextractorA function to extract test subject's property extractor)A syntax sugar to write fluent assertion using |
| public static InFilter | Returns: the created "in" filtervalues to match (one match is sufficient) values)Create a |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static List | |
| public static < the type of object the given condition accept. T> Not | |
| public static NotFilter | Returns: the created "not" filterthe value not to match valueNotToMatch)Create a |
| public static NotInFilter | Returns: the created "not in" filtervalues not to match (none of the values must match) valuesNotToMatch)Create a |
| public static Offset | |
| public static Offset | |
| public static void | registerCustomDateFormat(DateFormat
the new Date format used for String based Date assertions. userCustomDateFormat)Add the given date format to the ones used to parse date String in String based Date assertions like
|
| public static void | registerCustomDateFormat(String
the new Date format pattern used for String based Date assertions. userCustomDateFormatPattern)Add the given date format to the ones used to parse date String in String based Date assertions like
|
| public static < the type of format. T> void | registerFormatterForType(Class<T>
the class of the type to format type, Function<T, String> the formatter formatter)FunctionAssertions error messages uses a |
| public static void | setAllowComparingPrivateFields(boolean
allow private fields comparison. Default is true. allowComparingPrivateFields)Globally sets whether the use of private fields is allowed for comparison. |
| public static void | setAllowExtractingPrivateFields(boolean
allow private fields extraction. Default is true. allowExtractingPrivateFields)Globally sets whether
|
| public static void | setDescriptionConsumer(Consumer<Description>
the descriptionConsumer)Description consumerAll assertions description will be consumed by the given |
| public static void | setExtractBareNamePropertyMethods(boolean
whether bare-named property methods are found barenamePropertyMethods)Globally sets whether the extractor considers bare-named property methods like |
| public static void | setLenientDateParsing(boolean
whether lenient parsing mode should be enabled or not value)Instead of using default strict date/time parsing, it is possible to use lenient parsing mode for default date formats parser to interpret inputs that do not precisely match supported date formats (lenient parsing). |
| public static void | setMaxElementsForPrinting(int
the maximum elements that would be printed for iterables, arrays and maps. maxElementsForPrinting)Sets the maximum number of elements to display in error messages for iterables, arrays and map . |
| public static void | setMaxLengthForSingleLineDescription(int
the maximum length for an iterable/array to be displayed on one line maxLengthForSingleLineDescription)In error messages, sets the threshold when iterable/array formatting will be on one line (if their String description length <= this parameter) or it will be formatted with one element per line. |
| public static void | setMaxStackTraceElementsDisplayed(int
the maximum number of lines for a stacktrace to be displayed on one throw. maxStackTraceElementsDisplayed)Sets how many stacktrace elements are included in |
| public static void | setPrintAssertionsDescription(boolean
whether to print assertions description. printAssertionsDescription)Enable/disable printing assertions description to the console (disabled by default). |
| public static void | setRemoveAssertJRelatedElementsFromStackTrace(boolean
flag. removeAssertJRelatedElementsFromStackTrace)Sets whether we remove elements related to AssertJ from assertion error stack trace. |
| public static < dummy return value type T> T | Returns: nothing, it's just to be used indoSomething(optional.orElseGet(() -> shouldHaveThrown(IOException.class)));.the Throwable class that was expected to be thrown. throwableClass)Throws an |
| public static Tuple | Returns: the builtTuplethe values stored in the values)TupleUtility method to build nicely a |
| public static void | useDefaultDateFormatsOnly()
Remove all registered custom date formats => use only the defaults date formats to parse string as date. |
| public static void | useDefaultRepresentation()
Reset the representaion being used to the one from the |
| public static void | useRepresentation(Representation
the customRepresentation)Representation to useUse the given |
| public static Offset | Returns: the createdOffset.the allowed offset value)Alias for |
| public static Offset | Returns: the createdOffset.the allowed offset value)Alias for |
| public static Offset | Returns: the createdOffset.the allowed offset value)Assertions entry point for BigDecimal |
| public static Offset | Returns: the createdOffset.the allowed offset value)Assertions entry point for BigInteger |
| public static Offset | |
| public static Offset | |
| public static Offset | |
| public static Offset | |
| public static TemporalUnitOffset | Returns: the createdOffset.the allowed offset value, TemporalUnit the unit)TemporalUnit of the offsetAssertions entry point for |
| public static Percentage | Returns: the createdPercentage.the required precision percentage value)Assertions entry point for Double |
| public static Percentage | Returns: the createdPercentage.the required precision percentage value)Assertions entry point for Integer |
| public static Percentage | Returns: the createdPercentage.the required precision percentage value)Assertions entry point for Long |
| public static Duration | Returns: the given value.the allowed difference allowedDifference)Duration.Syntactic sugar method to use with |
| public static Offset | Returns: the createdOffset.the required precision value)Alias for |
| public static Offset | Returns: the createdOffset.the required precision value)Alias for |