Top Constructors Methods
org.assertj.core.api

public Class Java6BDDAssertions

extends Object
Class Inheritance
Annotations
@Deprecated
@CheckReturnValue
@SuppressWarnings:DeprecatedIsStillUsed, deprecation, RedundantSuppression
Static Imports
org.assertj.core.api.Assertions.assertThat, .Assertions.catchThrowable

Deprecated

For Android compatible assertions use the latest assertj 2.x version which is based on Java 7 only.

Android-compatible BDD-style assertions duplicated from BDDAssertions.

Since
2.5.0 / 3.5.0
See Also
BDDAssertions

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static AtomicBooleanAssert

Returns:

the created assertion object.
then
(AtomicBoolean
the actual value.
actual
)

Create assertion for AtomicBoolean.

public static AtomicIntegerAssert

Returns:

the created assertion object.
then
(AtomicInteger
the actual value.
actual
)

Create assertion for AtomicInteger.

public static AtomicIntegerArrayAssert

Returns:

the created assertion object.
then
(AtomicIntegerArray
the actual value.
actual
)

Create int[] assertion for AtomicIntegerArray.

public static <
the type of the object holding the updatable field.
OBJECT
>
AtomicIntegerFieldUpdaterAssert<OBJECT>

Returns:

the created assertion object.
then
(AtomicIntegerFieldUpdater<OBJECT>
the actual value.
actual
)

Create assertion for AtomicIntegerFieldUpdater.

public static AtomicLongAssert

Returns:

the created assertion object.
then
(AtomicLong
the actual value.
actual
)

Create assertion for AtomicLong.

public static AtomicLongArrayAssert

Returns:

the created assertion object.
then
(AtomicLongArray
the actual value.
actual
)

Create assertion for AtomicLongArray.

public static <
the type of the object holding the updatable field.
OBJECT
>
AtomicLongFieldUpdaterAssert<OBJECT>

Returns:

the created assertion object.
then
(AtomicLongFieldUpdater<OBJECT>
the actual value.
actual
)

Create assertion for AtomicLongFieldUpdater.

public static <
the type of the value contained in the AtomicReference.
VALUE
>
AtomicReferenceAssert<VALUE>

Returns:

the created assertion object.
then
(AtomicReference<VALUE>
the actual value.
actual
)

Create assertion for AtomicReference.

public static <
the type of the value contained in the AtomicReferenceArray.
ELEMENT
>
AtomicReferenceArrayAssert<ELEMENT>

Returns:

the created assertion object.
then
(AtomicReferenceArray<ELEMENT>
the actual value.
actual
)

Create assertion for AtomicReferenceArray.

public static <
the type of the field which gets updated by the AtomicReferenceFieldUpdater.
FIELD
,
the type of the object holding the updatable field.
OBJECT
>
AtomicReferenceFieldUpdaterAssert<FIELD, OBJECT>

Returns:

the created assertion object.
then
(AtomicReferenceFieldUpdater<OBJECT, FIELD>
the actual value.
actual
)

Create assertion for AtomicReferenceFieldUpdater.

public static <
the type of the value contained in the AtomicMarkableReference.
VALUE
>
AtomicMarkableReferenceAssert<VALUE>

Returns:

the created assertion object.
then
(AtomicMarkableReference<VALUE>
the actual value.
actual
)

Create assertion for AtomicMarkableReference.

public static <
the type of the value contained in the AtomicStampedReference.
VALUE
>
AtomicStampedReferenceAssert<VALUE>

Returns:

the created assertion object.
then
(AtomicStampedReference<VALUE>
the actual value.
actual
)

Create assertion for AtomicStampedReference.

public static AbstractBigDecimalAssert<?>

Returns:

the created assertion object.
then
(BigDecimal
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.BigDecimalAssert.

public static AbstractBigIntegerAssert<?>

Returns:

the created assertion object.
then
(BigInteger
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.BigIntegerAssert.

public static AbstractBooleanAssert<?>

Returns:

the created assertion object.
then
(boolean
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.BooleanAssert.

public static AbstractBooleanAssert<?>

Returns:

the created assertion object.
then
(Boolean
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.BooleanAssert.

public static AbstractBooleanArrayAssert<?>

Returns:

the created assertion object.
then
(boolean[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.BooleanArrayAssert.

public static Boolean2DArrayAssert

Returns:

the created assertion object.
then
(boolean[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Boolean2DArrayAssert.

public static AbstractByteAssert<?>

Returns:

the created assertion object.
then
(byte
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ByteAssert.

public static AbstractByteAssert<?>

Returns:

the created assertion object.
then
(Byte
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ByteAssert.

public static AbstractByteArrayAssert<?>

Returns:

the created assertion object.
then
(byte[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ByteArrayAssert.

public static Byte2DArrayAssert

Returns:

the created assertion object.
then
(byte[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Byte2DArrayAssert.

public static AbstractCharacterAssert<?>

Returns:

the created assertion object.
then
(char
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharacterAssert.

public static AbstractCharArrayAssert<?>

Returns:

the created assertion object.
then
(char[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharArrayAssert.

public static Char2DArrayAssert

Returns:

the created assertion object.
then
(char[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Char2DArrayAssert.

public static AbstractCharacterAssert<?>

Returns:

the created assertion object.
then
(Character
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharacterAssert.

public static AbstractClassAssert<?>

Returns:

the created assertion object.
then
(Class<?>
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ClassAssert

public static <
the actual elements type
T
>
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>>

Returns:

the created assertion object.
then
(Collection<? extends T>
the actual value.
actual
)

Creates a new instance of CollectionAssert.

public static <
the actual type
T extends Comparable<? super T>
>
AbstractComparableAssert<?, T>

Returns:

the created assertion object.
then
(T
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.GenericComparableAssert with standard comparison semantics.

public static <
the actual elements type
T
>
AbstractIterableAssert<?, Iterable<? extends T>, T, ObjectAssert<T>>

Returns:

the created assertion object.
then
(Iterable<? extends T>
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.IterableAssert.

public static <
the actual elements type
T
>
AbstractIteratorAssert<?, T>

Returns:

the created assertion object.
then
(Iterator<? extends T>
the actual value.
actual
)

Creates a new instance of IteratorAssert.

public static <
The actual type
ACTUAL extends Iterable<? extends ELEMENT>
,
The actual elements type
ELEMENT
,
The actual elements AbstractAssert type
ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>
>
FactoryBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT>

Returns:

the created assertion object.
then
(Iterable<? extends ELEMENT>
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 Iterable instance.
Creates a new instance of FactoryBasedNavigableIterableAssert allowing to navigate to any Iterable element in order to perform assertions on it.
public static <
The actual type
ACTUAL extends Iterable<? extends ELEMENT>
,
The actual elements type
ELEMENT
,
The actual elements AbstractAssert type
ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>
>
ClassBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT>

Returns:

the created assertion object.
then
(ACTUAL
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 Iterable instance.
Creates a new instance of ClassBasedNavigableIterableAssert allowing to navigate to any Iterable element in order to perform assertions on it.
public static <
The actual type
ACTUAL extends List<? extends ELEMENT>
,
The actual elements type
ELEMENT
,
The actual elements AbstractAssert type
ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>
>
FactoryBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT>

Returns:

the created assertion object.
then
(List<? extends ELEMENT>
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 List instance.
Creates a new instance of FactoryBasedNavigableListAssert 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 List<? extends ELEMENT>
,
The actual elements AbstractAssert type
ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>
>
ClassBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT>

Returns:

the created assertion object.
then
(List<? extends ELEMENT>
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 List instance.
Creates a new instance of ClassBasedNavigableListAssert allowing to navigate to any List element in order to perform assertions on it.
public static AbstractDoubleAssert<?>

Returns:

the created assertion object.
then
(double
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.DoubleAssert.

public static AbstractDoubleAssert<?>

Returns:

the created assertion object.
then
(Double
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.DoubleAssert.

public static AbstractDoubleArrayAssert<?>

Returns:

the created assertion object.
then
(double[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.DoubleArrayAssert.

public static Double2DArrayAssert

Returns:

the created assertion object.
then
(double[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Double2DArrayAssert.

public static AbstractFileAssert<?>

Returns:

the created assertion object.
then
(File
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.FileAssert.

public static <
the type of the value contained in the java.util.concurrent.Future.
RESULT
>
AbstractFutureAssert<?, ? extends Future<? extends RESULT>, RESULT>

Returns:

the created assertion object
then
(Future<RESULT>
the future to test
actual
)

Creates a new instance of org.assertj.core.api.FutureAssert.

public static AbstractInputStreamAssert<?, ? extends InputStream>

Returns:

the created assertion object.
then
(InputStream
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.InputStreamAssert.

public static AbstractFloatAssert<?>

Returns:

the created assertion object.
then
(float
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.FloatAssert.

public static AbstractFloatAssert<?>

Returns:

the created assertion object.
then
(Float
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.FloatAssert.

public static AbstractFloatArrayAssert<?>

Returns:

the created assertion object.
then
(float[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.FloatArrayAssert.

public static AbstractIntegerAssert<?>

Returns:

the created assertion object.
then
(int
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.IntegerAssert.

public static AbstractIntArrayAssert<?>

Returns:

the created assertion object.
then
(int[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.IntArrayAssert.

public static Int2DArrayAssert

Returns:

the created assertion object.
then
(int[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Int2DArrayAssert.

public static Float2DArrayAssert

Returns:

the created assertion object.
then
(float[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Float2DArrayAssert.

public static AbstractIntegerAssert<?>

Returns:

the created assertion object.
then
(Integer
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.IntegerAssert.

public static <
the actual elements type
T
>
AbstractListAssert<?, List<? extends T>, T, ObjectAssert<T>>

Returns:

the created assertion object.
then
(List<? extends T>
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ListAssert.

public static AbstractLongAssert<?>

Returns:

the created assertion object.
then
(long
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.LongAssert.

public static AbstractLongAssert<?>

Returns:

the created assertion object.
then
(Long
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.LongAssert.

public static AbstractLongArrayAssert<?>

Returns:

the created assertion object.
then
(long[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.LongArrayAssert.

public static Long2DArrayAssert

Returns:

the created assertion object.
then
(long[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Long2DArrayAssert.

public static <
the actual type
T
>
AbstractObjectAssert<?, T>

Returns:

the created assertion object.
then
(T
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ObjectAssert.

public static <
the actual elements type
T
>
AbstractObjectArrayAssert<?, T>

Returns:

the created assertion object.
then
(T[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ObjectArrayAssert.

public static <
the actual elements type
T
>
Object2DArrayAssert<T>

Returns:

the created assertion object.
then
(T[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Object2DArrayAssert.

public static <
the type of keys in the map.
K
,
the type of values in the map.
V
>
MapAssert<K, V>

Returns:

the created assertion object.
then
(Map<K, V>
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.MapAssert.

public static AbstractShortAssert<?>

Returns:

the created assertion object.
then
(short
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ShortAssert.

public static AbstractShortAssert<?>

Returns:

the created assertion object.
then
(Short
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ShortAssert.

public static AbstractShortArrayAssert<?>

Returns:

the created assertion object.
then
(short[]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ShortArrayAssert.

public static Short2DArrayAssert

Returns:

the created assertion object.
then
(short[][]
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.Short2DArrayAssert.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the created assertion object.
then
(CharSequence
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharSequenceAssert.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the created assertion object.
then
(StringBuilder
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharSequenceAssert from a StringBuilder.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the created assertion object.
then
(StringBuffer
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharSequenceAssert from a StringBuffer.

public static AbstractStringAssert<?>

Returns:

the created assertion object.
then
(String
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.StringAssert.

public static AbstractDateAssert<?>

Returns:

the created assertion object.
then
(Date
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.DateAssert.

public static <
the type of the actual throwable.
T extends Throwable
>
AbstractThrowableAssert<?, T>

Returns:

the created assertion Throwable.
then
(T
the actual value.
actual
)

Creates a new instance of ThrowableAssert.

public static AbstractUriAssert<?>

Returns:

the created assertion object.
then
(URI
the actual value.
actual
)

Creates a new instance of UriAssert.

public static AbstractUrlAssert<?>

Returns:

the created assertion object.
then
(URL
the actual value.
actual
)

Creates a new instance of UrlAssert.

public static <
the generic type of the user-defined assert.
T extends AssertDelegateTarget
>
T

Returns:

the given assertion.
then
(T
the assertion to return.
assertion
)

Returns the given assertion.

public static <
the AssertProvider wrapped type.
T
>
T

Returns:

the associated Assert of the given component
then
(final AssertProvider<T>
the component that creates its own assert
component
)

Delegates the creation of the Assert to the AssertProvider#assertThat() of the given component.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the created assertion object.
thenCharSequence
(CharSequence
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.CharSequenceAssert.

public AbstractThrowableAssert<?, ? extends Throwable>

Returns:

The captured exception or null if none was raised by the callable.
thenCode
(ThrowableAssert.ThrowingCallable
The ThrowingCallable or lambda with the code that should raise the throwable.
shouldRaiseOrNotThrowable
)

Allows to capture and then assert on a Throwable more easily when used with Java 8 lambdas.

public static <
the type of the actual value.
T
>
AbstractObjectAssert<?, T>

Returns:

the created assertion object.
thenObject
(T
the actual value.
actual
)

Creates a new instance of org.assertj.core.api.ObjectAssert for any object.

public static AbstractThrowableAssert<?, ? extends Throwable>

Returns:

The captured exception or null if none was raised by the callable.
thenThrownBy
(ThrowableAssert.ThrowingCallable
The ThrowingCallable or lambda with the code that should raise the throwable.
shouldRaiseThrowable
)

Allows to capture and then assert on a Throwable more easily when used with Java 8 lambdas.

public static AbstractThrowableAssert<?, ? extends Throwable>

Returns:

the created ThrowableAssert.
thenThrownBy
(ThrowableAssert.ThrowingCallable
The ThrowingCallable or lambda with the code that should raise the throwable.
shouldRaiseThrowable
,
String
the new description to set.
description
,
Object...
optional parameter if description is a format String.
args
)

Allows to capture and then assert on a Throwable like thenThrownBy(ThrowingCallable) but this method let you set the assertion description the same way you do with as(String, Object...).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait