Top Methods
org.assertj.core.api

public Interface BDDSoftAssertionsProvider

extends Java6BDDSoftAssertionsProvider
Known Direct Implementers
org.assertj.core.api.JUnitBDDSoftAssertions, org.assertj.core.api.JUnitJupiterBDDSoftAssertions, org.assertj.core.api.BDDSoftAssertions
Annotations
@CheckReturnValue
Imports
java.nio.file.Path, java.time.Duration, .Instant, .LocalDate, .LocalDateTime, .LocalTime, .OffsetDateTime, .OffsetTime, .Period, .YearMonth, .ZonedDateTime, java.time.temporal.Temporal, java.util.List, .Optional, .OptionalDouble, .OptionalInt, .OptionalLong, .Spliterator, java.util.concurrent.CompletableFuture, .CompletionStage, java.util.concurrent.atomic.LongAdder, java.util.function.DoublePredicate, .IntPredicate, .LongPredicate, .Predicate, java.util.regex.Matcher, java.util.stream.DoubleStream, .IntStream, .LongStream, .Stream, org.assertj.core.util.CheckReturnValue

Method Summary

Modifier and TypeMethod and Description
public default PathAssert
public default <
the type of the value contained in the Optional.
VALUE
>
OptionalAssert<VALUE>
public default OptionalDoubleAssert
public default OptionalIntAssert
public default OptionalLongAssert
public default MatcherAssert
public default TemporalAssert
public default LocalDateAssert
public default YearMonthAssert
public default LocalDateTimeAssert
public default ZonedDateTimeAssert
public default LocalTimeAssert
public default OffsetTimeAssert
public default OffsetDateTimeAssert
public default InstantAssert
public default DurationAssert
public default PeriodAssert
public default <
the type of the value contained in the java.util.concurrent.CompletableFuture.
RESULT
>
CompletableFutureAssert<RESULT>
public default <
the type of the value contained in the java.util.concurrent.CompletionStage.
RESULT
>
CompletableFutureAssert<RESULT>
public default <
the type of the value contained in the Predicate.
T
>
PredicateAssert<T>
public default IntPredicateAssert
public default DoublePredicateAssert
public default LongPredicateAssert
public default <
the type of elements.
ELEMENT
>
AbstractListAssert<?, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

Returns:

the created assertion object.
then
(Stream<? extends ELEMENT>
the actual Stream value.
actual
)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ListAssert from the given Stream.
public default AbstractListAssert<?, List<? extends Double>, Double, ObjectAssert<Double>>
public default AbstractListAssert<?, List<? extends Long>, Long, ObjectAssert<Long>>
public default AbstractListAssert<?, List<? extends Integer>, Integer, ObjectAssert<Integer>>
public default <
the type of elements.
ELEMENT
>
SpliteratorAssert<ELEMENT>
public default LongAdderAssert
public default AbstractPathAssert<?>

Returns:

the created assertion object
thenPath
(Path
the path to test
actual
)

Creates a new instance of PathAssert

Use this over then(Path) in case of ambiguous method resolution when the object under test implements several interfaces Assertj provides then for.

public default <
the type of the value contained in the Predicate.
T
>
PredicateAssert<T>

Returns:

the created assertion object.
thenPredicate
(Predicate<T>
the actual value.
actual
)

Create assertion for Predicate.

public default <
the type of elements.
ELEMENT
>
ListAssert<ELEMENT>

Returns:

the created assertion object.
thenStream
(Stream<? extends ELEMENT>
the actual value.
actual
)

Creates a new instance of ListAssert from the given Stream.

Inherited from org.assertj.core.api.Java6BDDSoftAssertionsProvider:
thenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenthenCharSequencethenCodethenCollectionthenComparablethenExceptionthenExceptionOfTypethenIllegalArgumentExceptionthenIllegalStateExceptionthenIndexOutOfBoundsExceptionthenIOExceptionthenIterablethenIteratorthenListthenNullPointerExceptionthenObjectthenReflectiveOperationExceptionthenRuntimeExceptionthenThrownBythenThrownBy

Method Detail

thenback to summary
public default PathAssert then(Path actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new, proxied instance of a PathAssert

Parameters
actual:Path

the path

Returns:PathAssert

the created assertion object

thenback to summary
public default <VALUE> OptionalAssert<VALUE> then(Optional<VALUE> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for Optional.

Parameters
<VALUE>
the type of the value contained in the Optional.
actual:Optional<VALUE>

the actual value.

Returns:OptionalAssert<VALUE>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default OptionalDoubleAssert then(OptionalDouble actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.OptionalDouble.

Parameters
actual:OptionalDouble

the actual value.

Returns:OptionalDoubleAssert

the created assertion object.

thenback to summary
public default OptionalIntAssert then(OptionalInt actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.OptionalInt.

Parameters
actual:OptionalInt

the actual value.

Returns:OptionalIntAssert

the created assertion object.

thenback to summary
public default OptionalLongAssert then(OptionalLong actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.OptionalLong.

Parameters
actual:OptionalLong

the actual value.

Returns:OptionalLongAssert

the created assertion object.

thenback to summary
public default MatcherAssert then(Matcher actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.regex.Matcher.

Parameters
actual:Matcher

the actual matcher

Returns:MatcherAssert

the created assertion object.

Annotations
@CheckReturnValue
thenback to summary
public default TemporalAssert then(Temporal actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of TemporalAssert.

Parameters
actual:Temporal

the actual value.

Returns:TemporalAssert

the created assertion object.

Since
3.26.0
thenback to summary
public default LocalDateAssert then(LocalDate actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of LocalDateAssert.

Parameters
actual:LocalDate

the actual value.

Returns:LocalDateAssert

the created assertion object.

thenback to summary
public default YearMonthAssert then(YearMonth actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of YearMonthAssert.

Parameters
actual:YearMonth

the actual value.

Returns:YearMonthAssert

the created assertion object.

Since
3.26.0
thenback to summary
public default LocalDateTimeAssert then(LocalDateTime actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of LocalDateTimeAssert.

Parameters
actual:LocalDateTime

the actual value.

Returns:LocalDateTimeAssert

the created assertion object.

thenback to summary
public default ZonedDateTimeAssert then(ZonedDateTime actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ZonedDateTimeAssert.

Parameters
actual:ZonedDateTime

the actual value.

Returns:ZonedDateTimeAssert

the created assertion object.

thenback to summary
public default LocalTimeAssert then(LocalTime actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of LocalTimeAssert.

Parameters
actual:LocalTime

the actual value.

Returns:LocalTimeAssert

the created assertion object.

thenback to summary
public default OffsetTimeAssert then(OffsetTime actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of OffsetTimeAssert.

Parameters
actual:OffsetTime

the actual value.

Returns:OffsetTimeAssert

the created assertion object.

thenback to summary
public default OffsetDateTimeAssert then(OffsetDateTime actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of OffsetDateTimeAssert.

Parameters
actual:OffsetDateTime

the actual value.

Returns:OffsetDateTimeAssert

the created assertion object.

thenback to summary
public default InstantAssert then(Instant actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of InstantAssert.

Parameters
actual:Instant

the actual value.

Returns:InstantAssert

the created assertion object.

Since
3.7.0
thenback to summary
public default DurationAssert then(Duration actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of DurationAssert.

Parameters
actual:Duration

the actual value.

Returns:DurationAssert

the created assertion object.

Since
3.15.0
thenback to summary
public default PeriodAssert then(Period actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of PeriodAssert.

Parameters
actual:Period

the actual value.

Returns:PeriodAssert

the created assertion object.

Since
3.17.0
thenback to summary
public default <RESULT> CompletableFutureAssert<RESULT> then(CompletableFuture<RESULT> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.concurrent.CompletableFuture.

Parameters
<RESULT>
the type of the value contained in the java.util.concurrent.CompletableFuture.
actual:CompletableFuture<RESULT>

the actual value.

Returns:CompletableFutureAssert<RESULT>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default <RESULT> CompletableFutureAssert<RESULT> then(CompletionStage<RESULT> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for java.util.concurrent.CompletionStage by converting it to a CompletableFuture and returning a CompletableFutureAssert.

If the given java.util.concurrent.CompletionStage is null, the CompletableFuture in the returned CompletableFutureAssert will also be null.

Parameters
<RESULT>
the type of the value contained in the java.util.concurrent.CompletionStage.
actual:CompletionStage<RESULT>

the actual value.

Returns:CompletableFutureAssert<RESULT>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default <T> PredicateAssert<T> then(Predicate<T> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for Predicate.

Parameters
<T>
the type of the value contained in the Predicate.
actual:Predicate<T>

the actual value.

Returns:PredicateAssert<T>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
Since
3.5.0
thenback to summary
public default IntPredicateAssert then(IntPredicate actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for IntPredicate.

Parameters
actual:IntPredicate

the actual value.

Returns:IntPredicateAssert

the created assertion object.

Since
3.5.0
thenback to summary
public default DoublePredicateAssert then(DoublePredicate actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for DoublePredicate.

Parameters
actual:DoublePredicate

the actual value.

Returns:DoublePredicateAssert

the created assertion object.

Since
3.5.0
thenback to summary
public default LongPredicateAssert then(LongPredicate actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for DoublePredicate.

Parameters
actual:LongPredicate

the actual value.

Returns:LongPredicateAssert

the created assertion object.

Since
3.5.0
thenback to summary
public default <ELEMENT> AbstractListAssert<?, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>> then(Stream<? extends ELEMENT> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ListAssert from the given Stream.

Be aware that to create the returned ListAssert the given the Stream is consumed so it won't be possible to use it again. Calling multiple methods on the returned ListAssert is safe as it only interacts with the List built from the Stream.

Parameters
<ELEMENT>
the type of elements.
actual:Stream<? extends ELEMENT>

the actual Stream value.

Returns:AbstractListAssert<?, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default AbstractListAssert<?, List<? extends Double>, Double, ObjectAssert<Double>> then(DoubleStream actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ListAssert from the given DoubleStream.

Be aware that to create the returned ListAssert the given the DoubleStream is consumed so it won't be possible to use it again. Calling multiple methods on the returned ListAssert is safe as it only interacts with the List built from the DoubleStream.

Parameters
actual:DoubleStream

the actual DoubleStream value.

Returns:AbstractListAssert<?, List<? extends Double>, Double, ObjectAssert<Double>>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default AbstractListAssert<?, List<? extends Long>, Long, ObjectAssert<Long>> then(LongStream actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ListAssert from the given LongStream.

Be aware that to create the returned ListAssert the given the LongStream is consumed so it won't be possible to use it again. Calling multiple methods on the returned ListAssert is safe as it only interacts with the List built from the LongStream.

Parameters
actual:LongStream

the actual LongStream value.

Returns:AbstractListAssert<?, List<? extends Long>, Long, ObjectAssert<Long>>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default AbstractListAssert<?, List<? extends Integer>, Integer, ObjectAssert<Integer>> then(IntStream actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of ListAssert from the given IntStream.

Be aware that to create the returned ListAssert the given the IntStream is consumed so it won't be possible to use it again. Calling multiple methods on the returned ListAssert is safe as it only interacts with the List built from the IntStream.

Parameters
actual:IntStream

the actual IntStream value.

Returns:AbstractListAssert<?, List<? extends Integer>, Integer, ObjectAssert<Integer>>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
thenback to summary
public default <ELEMENT> SpliteratorAssert<ELEMENT> then(Spliterator<ELEMENT> actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Creates a new instance of SpliteratorAssert from the given Spliterator.

Parameters
<ELEMENT>
the type of elements.
actual:Spliterator<ELEMENT>

the actual Spliterator value.

Returns:SpliteratorAssert<ELEMENT>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
Since
3.14.0
thenback to summary
public default LongAdderAssert then(LongAdder actual)

Overrides default org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then, org.assertj.core.api.Java6BDDSoftAssertionsProvider.then.

Create assertion for LongAdder.

Parameters
actual:LongAdder

the actual value.

Returns:LongAdderAssert

the created assertion object.

Since
3.16.0
thenPathback to summary
public default AbstractPathAssert<?> thenPath(Path actual)

Creates a new instance of PathAssert

Use this over then(Path) in case of ambiguous method resolution when the object under test implements several interfaces Assertj provides then for.

Parameters
actual:Path

the path to test

Returns:AbstractPathAssert<?>

the created assertion object

Since
3.23.0
thenPredicateback to summary
public default <T> PredicateAssert<T> thenPredicate(Predicate<T> actual)

Create assertion for Predicate.

Use this over then(Predicate) in case of ambiguous method resolution when the object under test implements several interfaces Assertj provides then for.

Parameters
<T>
the type of the value contained in the Predicate.
actual:Predicate<T>

the actual value.

Returns:PredicateAssert<T>

the created assertion object.

Since
3.23.0
thenStreamback to summary
public default <ELEMENT> ListAssert<ELEMENT> thenStream(Stream<? extends ELEMENT> actual)

Creates a new instance of ListAssert from the given Stream.

Use this over then(Stream) in case of ambiguous method resolution when the object under test implements several interfaces Assertj provides then for.

Be aware that to create the returned ListAssert the given the Stream is consumed so it won't be possible to use it again. Calling multiple methods on the returned ListAssert is safe as it only interacts with the List built from the Stream.

Parameters
<ELEMENT>
the type of elements.
actual:Stream<? extends ELEMENT>

the actual value.

Returns:ListAssert<ELEMENT>

the created assertion object.

Annotations
@SuppressWarnings:unchecked
Since
3.23.0