Deprecated
For Android compatible assertions use the latest assertj 2.x version which is based on Java 7 only.
Assertions compatible with Android. Duplicated from Assertions.
Assertions
| 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 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 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 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 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 AbstractClassAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of the actual value. T extends Comparable | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual elements type T> AbstractIterableAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the type of elements. T> AbstractIteratorAssert | 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> AbstractFutureAssertjava.. | 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 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 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 AbstractIntegerAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual elements type T> AbstractCollectionAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual elements type T> AbstractListAssert | 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 actual type T> AbstractObjectAssert | 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 < the generic type of the assert provided by the component. T> T | Returns: the associatedAssert of the given componentthe component that creates its own assert component)Delegates the creation of the |
| public static < the actual elements type T> AbstractObjectArrayAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static < the actual elements type T> Object2DArrayAssert | Returns: the created assertion object.the actual value. 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 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 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 AbstractDateAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| 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 AbstractCharSequenceAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractThrowableAssert | Returns: The captured exception ornull if none was raised by the callable.The shouldRaiseOrNotThrowableThrowingCallable or lambda with the code that should raise the throwable.Allows to capture and then assert on a |
| public < the type of the actual value. T> AbstractObjectAssert | Returns: the created assertion object.the actual value. actual)Creates a new instance of |
| public static AbstractThrowableAssert | Returns: The captured exception ornull if none was raised by the callable.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 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)Alias for |
| 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 allowed offset value)Assertions entry point for Byte |
| public static Offset | Returns: the createdOffset.the value of the offset. value)Assertions entry point for Integer |
| 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 Throwable | Returns: The captured exception ornull if none was raised by the callable.The lambda with the code that should raise the exception. shouldRaiseThrowableAllows to catch an |
| 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 Not 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 void | |
| public static void | fail(String
error message. failureMessage, Object... Arguments referenced by the format specifiers in the format string. args)Throws an |
| public static void | fail(String
the description of the failed assertion. It can be failureMessage, Throwable null.cause of the error. realCause)Throws an |
| public static void | failBecauseExceptionWasNotThrown(Class<? extends Throwable>
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 iterable elements type. E> Filters | Returns: the created.the iterableToFilter)Iterable to filter.Only delegate to |
| 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 < 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 void | setAllowComparingPrivateFields(boolean
allow private fields comparison. Default allowComparingPrivateFields)true.Globally sets whether the use of private fields is allowed for comparison. |
| public static void | setAllowExtractingPrivateFields(boolean
allow private fields extraction. Default allowExtractingPrivateFields)true.Globally sets whether
|
| 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 from one iterable/array/map maxElementsForPrinting)In error messages, sets the threshold for how many elements from one iterable/array/map will be included in the in the description. |
| 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 on one line (if their String description is less than 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 | shouldHaveThrown(Class<? extends Throwable>
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 Offset | Returns: the createdOffset.the value of the offset. value)Alias for |
| 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 | |
| public static Offset | |
| public static Offset | |
| public static Offset | |
| public static Percentage | Returns: the createdPercentage.the value of the percentage. value)Assertions entry point for Double |
| public static Percentage | Returns: the createdPercentage.the value of the percentage. value)Assertions entry point for Integer |
| public static Percentage | Returns: the createdPercentage.the value of the percentage. value)Assertions entry point for Long |