Top Description Constructors Methods
org.assertj.core.api

public final Class BDDAssumptions

extends Assumptions
Class Inheritance
Annotations
@CheckReturnValue
Imports
java.io.File, .IOException, .InputStream, java.math.BigDecimal, .BigInteger, java.net.URI, .URL, java.nio.file.Path, java.time.Duration, .Instant, .LocalDate, .LocalDateTime, .LocalTime, .OffsetDateTime, .OffsetTime, .Period, .ZonedDateTime, java.util.Collection, .Date, .Iterator, .List, .Map, .Optional, .OptionalDouble, .OptionalInt, .OptionalLong, .Spliterator, java.util.concurrent.CompletableFuture, .CompletionStage, .Future, java.util.concurrent.atomic.AtomicBoolean, .AtomicInteger, .AtomicIntegerArray, .AtomicIntegerFieldUpdater, .AtomicLong, .AtomicLongArray, .AtomicLongFieldUpdater, .AtomicMarkableReference, .AtomicReference, .AtomicReferenceArray, .AtomicReferenceFieldUpdater, .AtomicStampedReference, .LongAdder, java.util.function.DoublePredicate, .IntPredicate, .LongPredicate, .Predicate, java.util.regex.Matcher, java.util.stream.DoubleStream, .IntStream, .LongStream, .Stream, org.assertj.core.api.ThrowableAssert.ThrowingCallable, org.assertj.core.configuration.PreferredAssumptionException, org.assertj.core.util.CheckReturnValue

Behavior-driven development style entry point for assumption methods for different types, which allow to skip test execution when assumptions are not met.

The difference with the Assumptions class is that entry point methods are named given instead of assumeThat.

BDDAssumptions and BDDAssertions complement each other to allow a fluent Behavior-driven development.

Examples:

 String hobbit = "HOBBIT";
List<String> fellowshipOfTheRing = list("Aragorn", "Gandalf", "Frodo", "Legolas"); // and more

@Test
public void given_the_assumption_is_not_met_the_test_is_skipped() {
  given(hobbit).isEqualTo("ORC");
  // ... following code is not executed
  then(fellowshipOfTheRing).contains("Sauron");
}

@Test
public void given_the_assumption_is_met_the_test_is_executed() {
  given(hobbit).isEqualTo("HOBBIT");
  // ... following code is executed
  then(fellowshipOfTheRing).doesNotContain("Sauron");
}
Author
Gonzalo Müller
Since
3.14.0

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AbstractBooleanAssert<?>

Returns:

the AbstractBooleanAssert assertion object to be used for assumptions.
given
(boolean
the actual boolean value to be validated.
actual
)

Creates a new assumption's instance for a boolean value.

public static AbstractBooleanAssert<?>

Returns:

the AbstractBooleanAssert assertion object to be used for assumptions.
given
(Boolean
the actual Boolean value to be validated.
actual
)

Creates a new assumption's instance for a Boolean value.

public static AbstractBooleanArrayAssert<?>

Returns:

the AbstractBooleanArrayAssert assertion object to be used for assumptions.
given
(boolean[]
the actual booleans' array to be validated.
actual
)

Creates a new assumption's instance for a booleans' array.

public static Boolean2DArrayAssert

Returns:

the Boolean2DArrayAssert assertion object to be used for assumptions.
given
(boolean[][]
the actual booleans' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for a booleans' two-dimensional array.

public static AbstractByteAssert<?>

Returns:

the AbstractByteAssert assertion object to be used for assumptions.
given
(byte
the actual byte value to be validated.
actual
)

Creates a new assumption's instance for a byte value.

public static AbstractByteAssert<?>

Returns:

the AbstractByteAssert assertion object to be used for assumptions.
given
(Byte
the actual Byte value to be validated.
actual
)

Creates a new assumption's instance for a Byte value.

public static AbstractByteArrayAssert<?>

Returns:

the AbstractByteArrayAssert assertion object to be used for assumptions.
given
(byte[]
the actual bytes' array to be validated.
actual
)

Creates a new assumption's instance for a bytes' array.

public static Byte2DArrayAssert

Returns:

the Byte2DArrayAssert assertion object to be used for assumptions.
given
(byte[][]
the actual bytes' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for a bytes' two-dimensional array.

public static AbstractShortAssert<?>

Returns:

the AbstractShortAssert assertion object to be used for assumptions.
given
(short
the actual short value to be validated.
actual
)

Creates a new assumption's instance for a short value.

public static AbstractShortAssert<?>

Returns:

the AbstractShortAssert assertion object to be used for assumptions.
given
(Short
the actual Short value to be validated.
actual
)

Creates a new assumption's instance for a Short value.

public static AbstractShortArrayAssert<?>

Returns:

the AbstractShortArrayAssert assertion object to be used for assumptions.
given
(short[]
the actual shorts' array to be validated.
actual
)

Creates a new assumption's instance for a shorts' array.

public static Short2DArrayAssert

Returns:

the Short2DArrayAssert assertion object to be used for assumptions.
given
(short[][]
the actual shorts' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for a shorts' two-dimensional array.

public static AbstractIntegerAssert<?>

Returns:

the AbstractIntegerAssert assertion object to be used for assumptions.
given
(int
the actual int value to be validated.
actual
)

Creates a new assumption's instance for an int value.

public static AbstractIntegerAssert<?>

Returns:

the AbstractIntegerAssert assertion object to be used for assumptions.
given
(Integer
the actual Integer value to be validated.
actual
)

Creates a new assumption's instance for an Integer value.

public static AbstractIntArrayAssert<?>

Returns:

the AbstractIntArrayAssert assertion object to be used for assumptions.
given
(int[]
the actual ints' array to be validated.
actual
)

Creates a new assumption's instance for an ints' array.

public static Int2DArrayAssert

Returns:

the Int2DArrayAssert assertion object to be used for assumptions.
given
(int[][]
the actual ints' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for an ints' two-dimensional array.

public static AbstractBigIntegerAssert<?>

Returns:

the AbstractBigIntegerAssert assertion object to be used for assumptions.
given
(BigInteger
the actual BigInteger value to be validated.
actual
)

Creates a new assumption's instance for a BigInteger value.

public static AbstractLongAssert<?>

Returns:

the AbstractLongAssert assertion object to be used for assumptions.
given
(long
the actual long value to be validated.
actual
)

Creates a new assumption's instance for a long value.

public static AbstractLongAssert<?>

Returns:

the AbstractLongAssert assertion object to be used for assumptions.
given
(Long
the actual Long value to be validated.
actual
)

Creates a new assumption's instance for a Long value.

public static AbstractLongArrayAssert<?>

Returns:

the AbstractLongArrayAssert assertion object to be used for assumptions.
given
(long[]
the actual longs' array to be validated.
actual
)

Creates a new assumption's instance for a longs' array.

public static Long2DArrayAssert

Returns:

the Long2DArrayAssert assertion object to be used for assumptions.
given
(long[][]
the actual longs' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for a longs' two-dimensional array.

public static AbstractFloatAssert<?>

Returns:

the AbstractFloatAssert assertion object to be used for assumptions.
given
(float
the actual float value to be validated.
actual
)

Creates a new assumption's instance for a float value.

public static AbstractFloatAssert<?>

Returns:

the AbstractFloatAssert assertion object to be used for assumptions.
given
(Float
the actual Float value to be validated.
actual
)

Creates a new assumption's instance for a Float value.

public static AbstractFloatArrayAssert<?>

Returns:

the AbstractFloatArrayAssert assertion object to be used for assumptions.
given
(float[]
the actual floats' array to be validated.
actual
)

Creates a new assumption's instance for a floats' array.

public static Float2DArrayAssert

Returns:

the Float2DArrayAssert assertion object to be used for assumptions.
given
(float[][]
the actual floats' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for a floats' two-dimensional array.

public static AbstractDoubleAssert<?>

Returns:

the AbstractDoubleAssert assertion object to be used for assumptions.
given
(double
the actual double value to be validated.
actual
)

Creates a new assumption's instance for a double value.

public static AbstractDoubleAssert<?>

Returns:

the AbstractDoubleAssert assertion object to be used for assumptions.
given
(Double
the actual Double value to be validated.
actual
)

Creates a new assumption's instance for a Double value.

public static AbstractDoubleArrayAssert<?>

Returns:

the AbstractDoubleArrayAssert assertion object to be used for assumptions.
given
(double[]
the actual doubles' array to be validated.
actual
)

Creates a new assumption's instance for an doubles' array.

public static Double2DArrayAssert

Returns:

the Double2DArrayAssert assertion object to be used for assumptions.
given
(double[][]
the actual doubles' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for an doubles' two-dimensional array.

public static AbstractBigDecimalAssert<?>

Returns:

the AbstractBigDecimalAssert assertion object to be used for assumptions.
given
(BigDecimal
the actual BigDecimal value to be validated.
actual
)

Creates a new assumption's instance for a BigDecimal value.

public static AbstractCharacterAssert<?>

Returns:

the AbstractCharacterAssert assertion object to be used for assumptions.
given
(char
the actual char value to be validated.
actual
)

Creates a new assumption's instance for a char value.

public static AbstractCharacterAssert<?>

Returns:

the AbstractCharacterAssert assertion object to be used for assumptions.
given
(Character
the actual Character value to be validated.
actual
)

Creates a new assumption's instance for a Character value.

public static AbstractCharArrayAssert<?>

Returns:

the AbstractCharacterAssert assertion object to be used for assumptions.
given
(char[]
the actual chars' array to be validated.
actual
)

Creates a new assumption's instance for an chars' array.

public static Char2DArrayAssert

Returns:

the Char2DArrayAssert assertion object to be used for assumptions.
given
(char[][]
the actual chars' two-dimensional array to be validated.
actual
)

Creates a new assumption's instance for an chars' two-dimensional array.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the AbstractCharSequenceAssert assertion object to be used for assumptions.
given
(CharSequence
the actual CharSequence value to be validated.
actual
)

Creates a new assumption's instance for a CharSequence value.

public static AbstractStringAssert<?>

Returns:

the AbstractStringAssert assertion object to be used for assumptions.
given
(String
the actual String value to be validated.
actual
)

Creates a new assumption's instance for a String value.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the AbstractCharSequenceAssert assertion object to be used for assumptions.
given
(StringBuilder
the actual StringBuilder value to be validated.
actual
)

Creates a new assumption's instance for a StringBuilder value.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the AbstractCharSequenceAssert assertion object to be used for assumptions.
given
(StringBuffer
the actual StringBuffer value to be validated.
actual
)

Creates a new assumption's instance for a StringBuffer value.

public static ClassAssert

Returns:

the AbstractClassAssert assertion object to be used for assumptions.
given
(Class<?>
the actual Class value to be validated.
actual
)

Creates a new assumption's instance for a Class value.

public static <
the type of the actual object.
T
>
ObjectAssert<T>

Returns:

the AbstractObjectAssert assertion object to be used for assumptions.
given
(T
the actual object to be validated.
actual
)

Creates a new assumption's instance for an object value.

public static <
the type of elements of the actual objects' array.
T
>
ObjectArrayAssert<T>

Returns:

the AbstractObjectArrayAssert assertion object to be used for assumptions.
given
(T[]
the actual objects' array to be validated..
actual
)

Creates a new assumption's instance for an objects' array.

public static <
the type of elements of the actual objects' two-dimensional array.
T
>
Object2DArrayAssert<T>

Returns:

the Object2DArrayAssert assertion object to be used for assumptions.
given
(T[][]
the actual objects' two-dimensional array to be validated..
actual
)

Creates a new assumption's instance for an objects' two-dimensional array.

public static <
the type of the actual comparable value.
T extends Comparable<? super T>
>
AbstractComparableAssert<?, T>

Returns:

the AbstractComparableAssert assertion object to be used for assumptions.
given
(T
the actual Comparable value to be validated.
actual
)

Creates a new assumption's instance for a Comparable value.

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

Returns:

the AbstractThrowableAssert assertion object to be used for assumptions.
given
(T
the actual Throwable value to be validated.
actual
)

Creates a new assumption's instance for a Throwable value.

public static <
the type of elements of actual iterable value.
ELEMENT
>
IterableAssert<ELEMENT>

Returns:

the AbstractIterableAssert assertion object to be used for assumptions.
given
(Iterable<? extends ELEMENT>
the actual Iterable value to be validated.
actual
)

Creates a new assumption's instance for an Iterable value.

public static <
the type of elements of actual iterator value.
ELEMENT
>
IteratorAssert<ELEMENT>

Returns:

the AbstractIteratorAssert assertion object to be used for assumptions.
given
(Iterator<? extends ELEMENT>
the actual Iterator value to be validated.
actual
)

Creates a new assumption's instance for an Iterator value.

public static <
the type of elements.
E
>
AbstractCollectionAssert<?, Collection<? extends E>, E, ObjectAssert<E>>

Returns:

the created assumption for assertion object.
given
(Collection<? extends E>
the actual value.
actual
)

Creates a new assumption's instance for a Collection value.

public static <
the type of elements of actual list value.
ELEMENT
>
FactoryBasedNavigableListAssert<ListAssert<ELEMENT>, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
given
(List<? extends ELEMENT>
the actual List value to be validated.
actual
)

Creates a new assumption's instance for a List value.

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

Returns:

the AbstractMapAssert assertion object to be used for assumptions.
given
(Map<K, V>
the actual Map value to be validated.
actual
)

Creates a new assumption's instance for a Map value.

public static <
the type of the value contained in the actual predicate value.
T
>
PredicateAssert<T>

Returns:

the AbstractPredicateAssert assertion object to be used for assumptions.
given
(Predicate<T>
the actual Predicate value to be validated.
actual
)

Creates a new assumption's instance for a Predicate value.

public static IntPredicateAssert

Returns:

the IntPredicateAssert assertion object to be used for assumptions.
given
(IntPredicate
the actual IntPredicate value to be validated.
actual
)

Creates a new assumption's instance for an IntPredicate value.

public static LongPredicateAssert

Returns:

the LongPredicateAssert assertion object to be used for assumptions.
given
(LongPredicate
the actual LongPredicate value to be validated.
actual
)

Creates a new assumption's instance for a LongPredicate value.

public static DoublePredicateAssert

Returns:

the DoublePredicateAssert assertion object to be used for assumptions.
given
(DoublePredicate
the actual DoublePredicate value to be validated.
actual
)

Creates a new assumption's instance for a DoublePredicate value.

public static <
the type of the value contained in the actual optional value.
VALUE
>
OptionalAssert<VALUE>

Returns:

the OptionalAssert assertion object to be used for assumptions.
given
(Optional<VALUE>
the actual Optional value to be validated.
actual
)

Creates a new assumption's instance for an Optional value.

public static OptionalIntAssert

Returns:

the OptionalIntAssert assertion object to be used for assumptions.
given
(OptionalInt
the actual OptionalInt value to be validated.
actual
)

Creates a new assumption's instance for an OptionalInt value.

public static MatcherAssert

Returns:

the Matcher assertion object to be used for assumptions.
given
(Matcher
the actual Matcher value to be validated.
actual
)

Creates a new assumption's instance for an Matcher.

public static OptionalLongAssert

Returns:

the OptionalLongAssert assertion object to be used for assumptions.
given
(OptionalLong
the actual OptionalLong value to be validated.
actual
)

Creates a new assumption's instance for an OptionalLong value.

public static OptionalDoubleAssert

Returns:

the OptionalDoubleAssert assertion object to be used for assumptions.
given
(OptionalDouble
the actual OptionalDouble value to be validated.
actual
)

Creates a new assumption's instance for an OptionalDouble value.

public static <
the type of the value contained in the actual stream value.
ELEMENT
>
AbstractListAssert<?, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
given
(Stream<? extends ELEMENT>
the actual Stream value to be validated.
actual
)

Creates a new assumption's instance for a Stream value.

public static AbstractListAssert<?, List<? extends Integer>, Integer, ObjectAssert<Integer>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
given
(IntStream
the actual IntStream value to be validated.
actual
)

Creates a new assumption's instance for an IntStream value.

public static <
the type of the elements
ELEMENT
>
AbstractSpliteratorAssert<?, ELEMENT>

Returns:

the AbstractSpliteratorAssert assertion object to be used for assumptions.
given
(Spliterator<ELEMENT>
the actual Spliterator value to be validated.
actual
)

Creates a new assumption's instance for a Spliterator value.

public static AbstractListAssert<?, List<? extends Long>, Long, ObjectAssert<Long>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
given
(LongStream
the actual LongStream value to be validated.
actual
)

Creates a new assumption's instance for a LongStream value.

public static AbstractListAssert<?, List<? extends Double>, Double, ObjectAssert<Double>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
given
(DoubleStream
the actual DoubleStream value to be validated.
actual
)

Creates a new assumption's instance for a DoubleStream value.

public static <
the type of the value contained in the actual future value.
RESULT
>
AbstractFutureAssert<?, ? extends Future<? extends RESULT>, RESULT>

Returns:

the AbstractFutureAssert assertion object to be used for assumptions.
given
(Future<RESULT>
the Future value to be validated.
future
)

Creates a new assumption's instance for a Future value.

public static <
the type of the value contained in the actual future value.
RESULT
>
CompletableFutureAssert<RESULT>

Returns:

the AbstractCompletableFutureAssert assertion object to be used for assumptions.
given
(CompletableFuture<RESULT>
the CompletableFuture value to be validated.
future
)

Creates a new assumption's instance for a CompletableFuture value.

public static <
the type of the value contained in the actual future value.
RESULT
>
CompletableFutureAssert<RESULT>

Returns:

the AbstractCompletableFutureAssert assertion object to be used for assumptions.
given
(CompletionStage<RESULT>
the CompletionStage value to be validated.
stage
)

Creates a new assumption's instance for a CompletionStage value.

public static AtomicBooleanAssert

Returns:

the AtomicBooleanAssert assertion object to be used for assumptions.
given
(AtomicBoolean
the actual AtomicBoolean value to be validated.
actual
)

Creates a new assumption's instance for an AtomicBoolean value.

public static AtomicIntegerAssert

Returns:

the AtomicIntegerAssert assertion object to be used for assumptions.
given
(AtomicInteger
the actual AtomicInteger value to be validated.
actual
)

Creates a new assumption's instance for an AtomicInteger value.

public static AtomicIntegerArrayAssert

Returns:

the AtomicIntegerArrayAssert assertion object to be used for assumptions.
given
(AtomicIntegerArray
the actual AtomicIntegerArray value to be validated.
actual
)

Creates a new assumption's instance for an AtomicIntegerArray value.

public static <
the type of the object holding the updatable field which gets updated by the actual value.
OBJECT
>
AtomicIntegerFieldUpdaterAssert<OBJECT>

Returns:

the AtomicIntegerFieldUpdaterAssert assertion object to be used for assumptions.
given
(AtomicIntegerFieldUpdater<OBJECT>
the actual AtomicIntegerFieldUpdater value to be validated.
actual
)

Creates a new assumption's instance for an AtomicIntegerFieldUpdater value.

public static LongAdderAssert

Returns:

the LongAdderAssert assertion object to be used for assumptions.
given
(LongAdder
the actual LongAdder value to be validated.
actual
)

Creates a new assumption's instance for a LongAdder value.

public static AtomicLongAssert

Returns:

the AtomicLongAssert assertion object to be used for assumptions.
given
(AtomicLong
the actual AtomicLong value to be validated.
actual
)

Creates a new assumption's instance for an AtomicLong value.

public static AtomicLongArrayAssert

Returns:

the AtomicLongArrayAssert assertion object to be used for assumptions.
given
(AtomicLongArray
the actual AtomicLongArray value to be validated.
actual
)

Creates a new assumption's instance for an AtomicLongArray value.

public static <
the type of the object holding the updatable field which gets updated by the actual value.
OBJECT
>
AtomicLongFieldUpdaterAssert<OBJECT>

Returns:

the AtomicLongFieldUpdaterAssert assertion object to be used for assumptions.
given
(AtomicLongFieldUpdater<OBJECT>
the actual AtomicLongFieldUpdater value to be validated.
actual
)

Creates a new assumption's instance for an AtomicLongFieldUpdater value.

public static <
the type of the value contained by the actual reference.
VALUE
>
AtomicReferenceAssert<VALUE>

Returns:

the AtomicReferenceAssert assertion object to be used for assumptions.
given
(AtomicReference<VALUE>
the actual AtomicReference to be validated.
actual
)

Creates a new assumption's instance for an AtomicReference value.

public static <
the type of the value contained in the actual references' array.
ELEMENT
>
AtomicReferenceArrayAssert<ELEMENT>

Returns:

the AtomicReferenceArrayAssert assertion object to be used for assumptions.
given
(AtomicReferenceArray<ELEMENT>
the actual AtomicReferenceArray to be validated.
actual
)

Creates a new assumption's instance for an AtomicReferenceArray value.

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

Returns:

the AtomicReferenceFieldUpdaterAssert assertion object to be used for assumptions.
given
(AtomicReferenceFieldUpdater<OBJECT, FIELD>
the actual AtomicReferenceFieldUpdater value to be validated.
actual
)

Creates a new assumption's instance for an AtomicReferenceFieldUpdater value.

public static <
the type of the value contained by the actual reference.
VALUE
>
AtomicMarkableReferenceAssert<VALUE>

Returns:

the AtomicMarkableReferenceAssert assertion object to be used for assumptions.
given
(AtomicMarkableReference<VALUE>
the actual AtomicMarkableReference to be validated.
actual
)

Creates a new assumption's instance for an AtomicMarkableReference value.

public static <
the type of the value contained by the actual reference.
VALUE
>
AtomicStampedReferenceAssert<VALUE>

Returns:

the AtomicStampedReferenceAssert assertion object to be used for assumptions.
given
(AtomicStampedReference<VALUE>
the actual AtomicStampedReference to be validated.
actual
)

Creates a new assumption's instance for an AtomicStampedReference value.

public static AbstractDateAssert<?>

Returns:

the AbstractDateAssert assertion object to be used for assumptions.
given
(Date
the actual Date value to be validated.
actual
)

Creates a new assumption's instance for a Date value.

public static AbstractLocalDateAssert<?>

Returns:

the AbstractLocalDateAssert assertion object to be used for assumptions.
given
(LocalDate
the actual LocalDate value to be validated.
actual
)

Creates a new assumption's instance for a LocalDate value.

public static AbstractLocalTimeAssert<?>

Returns:

the AbstractLocalTimeAssert assertion object to be used for assumptions.
given
(LocalTime
the actual LocalTime value to be validated.
actual
)

Creates a new assumption's instance for a LocalTime value.

public static AbstractOffsetTimeAssert<?>

Returns:

the AbstractOffsetTimeAssert assertion object to be used for assumptions.
given
(OffsetTime
the actual OffsetTime value to be validated.
actual
)

Creates a new assumption's instance for an OffsetTime value.

public static AbstractLocalDateTimeAssert<?>

Returns:

the AbstractLocalDateTimeAssert assertion object to be used for assumptions.
given
(LocalDateTime
the actual LocalDateTime value to be validated.
actual
)

Creates a new assumption's instance for a LocalDateTime value.

public static AbstractInstantAssert<?>

Returns:

the AbstractInstantAssert assertion object to be used for assumptions.
given
(Instant
the actual Instant value to be validated.
actual
)

Creates a new assumption's instance for an Instant value.

public static AbstractDurationAssert<?>

Returns:

the created assertion object.
given
(Duration
the actual value.
actual
)

Creates a new assumption's instance for a Instant value.

public static AbstractPeriodAssert<?>

Returns:

the created assertion object.
given
(Period
the actual value.
actual
)

Creates a new assumption's instance for a java.time.Period value.

public static AbstractOffsetDateTimeAssert<?>

Returns:

the AbstractOffsetDateTimeAssert assertion object to be used for assumptions.
given
(OffsetDateTime
the actual OffsetDateTime value to be validated.
actual
)

Creates a new assumption's instance for an OffsetDateTime value.

public static AbstractZonedDateTimeAssert<?>

Returns:

the AbstractZonedDateTimeAssert assertion object to be used for assumptions.
given
(ZonedDateTime
the actual ZonedDateTime value to be validated.
actual
)

Creates a new assumption's instance for a ZonedDateTime value.

public static AbstractInputStreamAssert<?, ? extends InputStream>

Returns:

the AbstractInputStreamAssert assertion object to be used for assumptions.
given
(InputStream
the actual InputStream value to be validated.
actual
)

Creates a new assumption's instance for an InputStream value.

public static AbstractFileAssert<?>

Returns:

the AbstractFileAssert assertion object to be used for assumptions.
given
(File
the actual File value to be validated.
actual
)

Creates a new assumption's instance for a File value.

public static AbstractPathAssert<?>

Returns:

the AbstractPathAssert assertion object to be used for assumptions.
given
(Path
the actual Path value to be validated.
actual
)

Creates a new assumption's instance for a Path value.

public static AbstractUriAssert<?>

Returns:

the AbstractUriAssert assertion object to be used for assumptions.
given
(URI
the actual URI value to be validated.
actual
)

Creates a new assumption's instance for an URI value.

public static AbstractUrlAssert<?>

Returns:

the AbstractUrlAssert assertion object to be used for assumptions.
given
(URL
the actual URL value to be validated.
actual
)

Creates a new assumption's instance for an URL value.

public static AbstractCharSequenceAssert<?, ? extends CharSequence>

Returns:

the AbstractCharSequenceAssert assertion object to be used for assumptions.
givenCharSequence
(CharSequence
the actual CharSequence value to be validated.
actual
)

Creates a new assumption's instance for a CharSequence value.

public static AbstractThrowableAssert<?, ? extends Throwable>

Returns:

the AbstractThrowableAssert assertion object to be used for assumptions.
givenCode
(ThrowableAssert.ThrowingCallable
the ThrowingCallable or lambda with the code that may raise a throwable to be validated.
lambda
)

Creates a new assumption's instance from a no parameters lambda expression, () -> { /* some code */ }.

public static <
the type of elements.
E
>
AbstractCollectionAssert<?, Collection<? extends E>, E, ObjectAssert<E>>

Returns:

the created assumption for assertion object.
givenCollection
(Collection<? extends E>
the actual value.
actual
)

Creates a new assumption's instance of a Collection value.

public static <
the type of elements.
T extends Comparable<? super T>
>
AbstractComparableAssert<?, T>

Returns:

the created assumption for assertion object.
givenComparable
(T
the actual value.
actual
)

Creates a new assumption's instance of a Comparable value.

public static ThrowableTypeAssert<Exception>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenException
()

Alias for givenExceptionOfType(Class) for Exception.

public static <
the exception type.
T extends Throwable
>
ThrowableTypeAssert<T>

Returns:

the created ThrowableTypeAssert.
givenExceptionOfType
(final Class<? extends T>
the exception type class.
exceptionType
)

Creates a new assumption's instance for a Throwable value.

public static ThrowableTypeAssert<IllegalArgumentException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenIllegalArgumentException
()

Alias for givenExceptionOfType(Class) for IllegalArgumentException.

public static ThrowableTypeAssert<IndexOutOfBoundsException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenIndexOutOfBoundsException
()

Alias for givenExceptionOfType(Class) for IndexOutOfBoundsException.

public static ThrowableTypeAssert<IOException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenIOException
()

Alias for givenExceptionOfType(Class) for IOException.

public static <
the type of elements of actual iterable value.
ELEMENT
>
IterableAssert<ELEMENT>

Returns:

the AbstractIterableAssert assertion object to be used for assumptions.
givenIterable
(Iterable<? extends ELEMENT>
the actual Iterable value to be validated.
actual
)

Creates a new assumption's instance of an Iterable value.

public static <
the type of elements of actual iterable value.
ELEMENT
>
IteratorAssert<ELEMENT>

Returns:

the AbstractIteratorAssert assertion object to be used for assumptions.
givenIterator
(Iterator<? extends ELEMENT>
the actual Iterator value to be validated.
actual
)

Creates a new assumption's instance of an Iterator value.

public static <
the type of elements.
ELEMENT
>
FactoryBasedNavigableListAssert<ListAssert<ELEMENT>, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
givenList
(List<? extends ELEMENT>
the actual value.
actual
)

Creates a new assumption's instance of a List value.

public static ThrowableTypeAssert<NullPointerException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenNullPointerException
()

Alias for givenExceptionOfType(Class) for NullPointerException.

public static <
the type of the actual object.
T
>
ObjectAssert<T>

Returns:

the AbstractObjectAssert assertion object to be used for assumptions.
givenObject
(T
the actual object to be validated.
actual
)

Creates a new assumption's instance for an object value.

public static AbstractPathAssert<?>

Returns:

the AbstractPathAssert assertion object to be used for assumptions.
givenPath
(Path
the actual Path value to be validated.
actual
)

Creates a new assumption's instance of a Path value.

public static <
the type of elements.
T
>
PredicateAssert<T>

Returns:

the AbstractPredicateAssert assertion object to be used for assumptions.
givenPredicate
(Predicate<T>
the actual value.
actual
)

Creates a new assumption's instance of a Predicate value.

public static ThrowableTypeAssert<ReflectiveOperationException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenReflectiveOperationException
()

Alias for givenExceptionOfType(Class) for ReflectiveOperationException.

public static ThrowableTypeAssert<RuntimeException>

Returns:

the ThrowableAssert assertion object to be used for assumptions.
givenRuntimeException
()

Alias for givenExceptionOfType(Class) for RuntimeException.

public static <
the type of elements.
ELEMENT
>
AbstractListAssert<?, List<? extends ELEMENT>, ELEMENT, ObjectAssert<ELEMENT>>

Returns:

the AbstractListAssert assertion object to be used for assumptions.
givenStream
(Stream<? extends ELEMENT>
the actual Stream value to be validated.
actual
)

Creates a new assumption's instance of a Stream value.

public static void
setPreferredAssumptionException(PreferredAssumptionException
the preferred exception to use with BDDAssumptions.
preferredAssumptionException
)

Hides org.assertj.core.api.Assumptions.setPreferredAssumptionException.

Sets which exception is thrown if an assumption is not met.
Inherited from org.assertj.core.api.Assumptions:
assumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatassumeThatCharSequenceassumeThatCodeassumeThatCollectionassumeThatComparableassumeThatExceptionassumeThatExceptionOfTypeassumeThatIllegalArgumentExceptionassumeThatIndexOutOfBoundsExceptionassumeThatIOExceptionassumeThatIterableassumeThatIteratorassumeThatListassumeThatNullPointerExceptionassumeThatObjectassumeThatPathassumeThatPredicateassumeThatReflectiveOperationExceptionassumeThatRuntimeExceptionassumeThatStreamassumeThatThrownBygenerateAssumptionClass