Package org.assertj.core.api
Interface WithAssumptions
-
public interface WithAssumptions
A unified entry point to all assumptions from both the new Java 8 core API and the pre-Java 8 core API. As a convenience, the methods are defined in an interface so that no static imports are necessary if the test class implements this interface.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default BooleanAssert
assumeThat(boolean actual)
Creates a new instance of
assumption.BooleanAssert
default BooleanArrayAssert
assumeThat(boolean[] actual)
Creates a new instance of
assumption.BooleanArrayAssert
default Boolean2DArrayAssert
assumeThat(boolean[][] actual)
Creates a new instance of
assumption.Boolean2DArrayAssert
default ByteAssert
assumeThat(byte actual)
Creates a new instance of
assumption.ByteAssert
default ByteArrayAssert
assumeThat(byte[] actual)
Creates a new instance of
assumption.ByteArrayAssert
default Byte2DArrayAssert
assumeThat(byte[][] actual)
Creates a new instance of
assumption.Byte2DArrayAssert
default CharacterAssert
assumeThat(char actual)
Creates a new instance of
assumption.CharacterAssert
default CharArrayAssert
assumeThat(char[] actual)
Creates a new instance of
assumption.CharArrayAssert
default Char2DArrayAssert
assumeThat(char[][] actual)
Creates a new instance of
assumption.Char2DArrayAssert
default DoubleAssert
assumeThat(double actual)
Creates a new instance of
assumption.DoubleAssert
default DoubleArrayAssert
assumeThat(double[] actual)
Creates a new instance of
assumption.DoubleArrayAssert
default Double2DArrayAssert
assumeThat(double[][] actual)
Creates a new instance of
assumption.Double2DArrayAssert
default FloatAssert
assumeThat(float actual)
Creates a new instance of
assumption.FloatAssert
default FloatArrayAssert
assumeThat(float[] actual)
Creates a new instance of
assumption.FloatArrayAssert
default Float2DArrayAssert
assumeThat(float[][] actual)
Creates a new instance of
assumption.Float2DArrayAssert
default IntegerAssert
assumeThat(int actual)
Creates a new instance of
assumption.IntegerAssert
default IntArrayAssert
assumeThat(int[] actual)
Creates a new instance of
assumption.IntArrayAssert
default Int2DArrayAssert
assumeThat(int[][] actual)
Creates a new instance of
assumption.Int2DArrayAssert
default LongAssert
assumeThat(long actual)
Creates a new instance of
assumption.LongAssert
default LongArrayAssert
assumeThat(long[] actual)
Creates a new instance of
assumption.LongArrayAssert
default Long2DArrayAssert
assumeThat(long[][] actual)
Creates a new instance of
assumption.Long2DArrayAssert
default ShortAssert
assumeThat(short actual)
Creates a new instance of
assumption.ShortAssert
default ShortArrayAssert
assumeThat(short[] actual)
Creates a new instance of
assumption.ShortArrayAssert
default Short2DArrayAssert
assumeThat(short[][] actual)
Creates a new instance of
assumption.Short2DArrayAssert
default FileAssert
assumeThat(File actual)
Creates a new instance of
assumption.FileAssert
default InputStreamAssert
assumeThat(InputStream actual)
Creates a new instance of
assumption.InputStreamAssert
default BooleanAssert
assumeThat(Boolean actual)
Creates a new instance of
assumption.BooleanAssert
default ByteAssert
assumeThat(Byte actual)
Creates a new instance of
assumption.ByteAssert
default CharacterAssert
assumeThat(Character actual)
Creates a new instance of
assumption.CharacterAssert
default CharSequenceAssert
assumeThat(CharSequence actual)
Creates a new instance of
assumption.CharSequenceAssert
default ClassAssert
assumeThat(Class<?> actual)
Creates a new instance of
assumption.ClassAssert
default DoubleAssert
assumeThat(Double actual)
Creates a new instance of
assumption.DoubleAssert
default FloatAssert
assumeThat(Float actual)
Creates a new instance of
assumption.FloatAssert
default IntegerAssert
assumeThat(Integer actual)
Creates a new instance of
assumption.IntegerAssert
default <ELEMENT> IterableAssert<ELEMENT>
assumeThat(Iterable<? extends ELEMENT> actual)
Creates a new instance of
assumption.IterableAssert
default LongAssert
assumeThat(Long actual)
Creates a new instance of
assumption.LongAssert
default ShortAssert
assumeThat(Short actual)
Creates a new instance of
assumption.ShortAssert
default StringAssert
assumeThat(String actual)
Creates a new instance of
assumption.StringAssert
default CharSequenceAssert
assumeThat(StringBuffer actual)
Creates a new instance of
assumption from aCharSequenceAssert
StringBuffer
.default CharSequenceAssert
assumeThat(StringBuilder actual)
Creates a new instance of
assumption from aCharSequenceAssert
StringBuilder
.default ThrowableAssert
assumeThat(Throwable actual)
Creates a new instance of
assumption.ThrowableAssert
default BigDecimalAssert
assumeThat(BigDecimal actual)
Creates a new instance of
assumption.BigDecimalAssert
default BigIntegerAssert
assumeThat(BigInteger actual)
Creates a new instance of
assumption.BigIntegerAssert
default UriAssert
assumeThat(URI uri)
Creates a new instance of
assumption.UriAssert
default UrlAssert
assumeThat(URL url)
Creates a new instance of
assumption.UrlAssert
default PathAssert
assumeThat(Path actual)
Creates a new instance of
assumption.PathAssert
default DurationAssert
assumeThat(Duration duration)
Creates a new instance of
assumption.DurationAssert
default InstantAssert
assumeThat(Instant instant)
Creates a new instance of
assumption.InstantAssert
default LocalDateAssert
assumeThat(LocalDate localDate)
Creates a new instance of
assumption.LocalDateAssert
default LocalDateTimeAssert
assumeThat(LocalDateTime localDateTime)
Creates a new instance of
assumption.LocalDateTimeAssert
default LocalTimeAssert
assumeThat(LocalTime localTime)
Creates a new instance of
assumption.LocalTimeAssert
default OffsetDateTimeAssert
assumeThat(OffsetDateTime offsetDateTime)
Creates a new instance of
assumption.OffsetDateTimeAssert
default OffsetTimeAssert
assumeThat(OffsetTime offsetTime)
Creates a new instance of
assumption.OffsetTimeAssert
default PeriodAssert
assumeThat(Period period)
Creates a new instance of
assumption.PeriodAssert
default ZonedDateTimeAssert
assumeThat(ZonedDateTime zonedDateTime)
Creates a new instance of
assumption.ZonedDateTimeAssert
default AtomicBooleanAssert
assumeThat(AtomicBoolean actual)
Creates a new instance of
assumption.AtomicBooleanAssert
default AtomicIntegerAssert
assumeThat(AtomicInteger actual)
Creates a new instance of
assumption.AtomicIntegerAssert
default AtomicIntegerArrayAssert
assumeThat(AtomicIntegerArray actual)
Creates int[] assumption forAtomicIntegerArray
.default <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT>
assumeThat(AtomicIntegerFieldUpdater<OBJECT> actual)
Creates a new instance of
assumption.AtomicIntegerFieldUpdaterAssert
default AtomicLongAssert
assumeThat(AtomicLong actual)
Creates a new instance of
assumption.AtomicLongAssert
default AtomicLongArrayAssert
assumeThat(AtomicLongArray actual)
Creates a new instance of
assumption.AtomicLongArrayAssert
default <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT>
assumeThat(AtomicLongFieldUpdater<OBJECT> actual)
Creates a new instance of
assumption.AtomicLongFieldUpdaterAssert
default <VALUE> AtomicMarkableReferenceAssert<VALUE>
assumeThat(AtomicMarkableReference<VALUE> actual)
Creates a new instance of
assumption.AtomicMarkableReferenceAssert
default <VALUE> AtomicReferenceAssert<VALUE>
assumeThat(AtomicReference<VALUE> actual)
Creates a new instance of
assumption.AtomicReferenceAssert
default <ELEMENT> AtomicReferenceArrayAssert<ELEMENT>
assumeThat(AtomicReferenceArray<ELEMENT> actual)
Creates a new instance of
assumption.AtomicReferenceArrayAssert
default <FIELD,OBJECT>
AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>assumeThat(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
Creates a new instance of
assumption.AtomicReferenceFieldUpdaterAssert
default <VALUE> AtomicStampedReferenceAssert<VALUE>
assumeThat(AtomicStampedReference<VALUE> actual)
Creates a new instance of
assumption.AtomicStampedReferenceAssert
default LongAdderAssert
assumeThat(LongAdder actual)
Creates a new instance of
assumption.LongAdderAssert
default <RESULT> CompletableFutureAssert<RESULT>
assumeThat(CompletableFuture<RESULT> future)
Creates a new instance ofCompletableFutureAssert
assumption.default <RESULT> CompletableFutureAssert<RESULT>
assumeThat(CompletionStage<RESULT> actual)
Creates a new instance ofCompletableFutureAssert
assumption for aCompletionStage
by converting it to aCompletableFuture
and returning aCompletableFutureAssert
.default <RESULT> FutureAssert<RESULT>
assumeThat(Future<RESULT> actual)
Create assertion forFutureAssert
assumption.default DateAssert
assumeThat(Date actual)
Creates a new instance of
assumption.DateAssert
default DoublePredicateAssert
assumeThat(DoublePredicate doublePredicate)
Creates a new instance ofDoublePredicateAssert
assumption.default IntPredicateAssert
assumeThat(IntPredicate intPredicate)
Creates a new instance ofIntPredicateAssert
assumption.default LongPredicateAssert
assumeThat(LongPredicate longPredicate)
Creates a new instance ofLongPredicateAssert
assumption.default <T> PredicateAssert<T>
assumeThat(Predicate<T> predicate)
Creates a new instance ofPredicateAssert
assumption.default <ELEMENT> IteratorAssert<ELEMENT>
assumeThat(Iterator<? extends ELEMENT> actual)
Creates a new instance of
assumption.IteratorAssert
default <ELEMENT> ListAssert<ELEMENT>
assumeThat(List<? extends ELEMENT> list)
Creates a new instance of
assumption.ListAssert
default <K,V>
MapAssert<K,V>assumeThat(Map<K,V> actual)
Creates a new instance of
assumption.MapAssert
default <VALUE> OptionalAssert<VALUE>
assumeThat(Optional<VALUE> optional)
Creates a new instance ofOptionalAssert
assumption.default OptionalDoubleAssert
assumeThat(OptionalDouble optionalDouble)
Creates a new instance of
assumption.OptionalDoubleAssert
default OptionalIntAssert
assumeThat(OptionalInt optionalInt)
Creates a new instance of
assumption.OptionalIntAssert
default OptionalLongAssert
assumeThat(OptionalLong optionalLong)
Creates a new instance of
assumption.OptionalLongAssert
default <ELEMENT> SpliteratorAssert<ELEMENT>
assumeThat(Spliterator<ELEMENT> spliterator)
Creates a new instance of
assumption.SpliteratorAssert
default ListAssert<Double>
assumeThat(DoubleStream doubleStream)
Creates a new instance of
assumption from the givenListAssert
DoubleStream
.default ListAssert<Integer>
assumeThat(IntStream intStream)
Creates a new instance of
assumption from the givenListAssert
IntStream
.default ListAssert<Long>
assumeThat(LongStream longStream)
Creates a new instance of
assumption from the givenListAssert
LongStream
.default <ELEMENT> ListAssert<ELEMENT>
assumeThat(Stream<? extends ELEMENT> stream)
Creates a new instance of
assumption from the givenListAssert
Stream
.default <T> ObjectAssert<T>
assumeThat(T actual)
Creates a new instance of
assumption.ObjectAssert
default <T> ObjectArrayAssert<T>
assumeThat(T[] actual)
Creates a new instance of
assumption.ObjectArrayAssert
default <T> Object2DArrayAssert<T>
assumeThat(T[][] actual)
Creates a new instance of
assumption.Object2DArrayAssert
default ThrowableAssert
assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assume on aThrowable
(easier done with lambdas).default <T> ObjectAssert<T>
assumeThatObject(T actual)
Creates a new instance of
for any object.ObjectAssert
default ThrowableAssert
assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assume on aThrowable
(easier done with lambdas).
-
-
-
Method Detail
-
assumeThat
default <T> ObjectArrayAssert<T> assumeThat(T[] actual)
Creates a new instance of
assumption.ObjectArrayAssert
- Type Parameters:
T
- the type of elements.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <T> Object2DArrayAssert<T> assumeThat(T[][] actual)
Creates a new instance of
assumption.Object2DArrayAssert
- Type Parameters:
T
- the type of elements.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default <K,V> MapAssert<K,V> assumeThat(Map<K,V> actual)
Creates a new instance of
assumption.MapAssert
- Type Parameters:
K
- the type of keys in the map.V
- the type of values in the map.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ShortAssert assumeThat(short actual)
Creates a new instance of
assumption.ShortAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LongAssert assumeThat(long actual)
Creates a new instance of
assumption.LongAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LongAssert assumeThat(Long actual)
Creates a new instance of
assumption.LongAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LongArrayAssert assumeThat(long[] actual)
Creates a new instance of
assumption.LongArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Long2DArrayAssert assumeThat(long[][] actual)
Creates a new instance of
assumption.Long2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default <T> ObjectAssert<T> assumeThat(T actual)
Creates a new instance of
assumption.ObjectAssert
- Type Parameters:
T
- the type of the actual value.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default StringAssert assumeThat(String actual)
Creates a new instance of
assumption.StringAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default DateAssert assumeThat(Date actual)
Creates a new instance of
assumption.DateAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ThrowableAssert assumeThat(Throwable actual)
Creates a new instance of
assumption.ThrowableAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default BigDecimalAssert assumeThat(BigDecimal actual)
Creates a new instance of
assumption.BigDecimalAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default BigIntegerAssert assumeThat(BigInteger actual)
Creates a new instance of
assumption.BigIntegerAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AtomicBooleanAssert assumeThat(AtomicBoolean actual)
Creates a new instance of
assumption.AtomicBooleanAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AtomicIntegerAssert assumeThat(AtomicInteger actual)
Creates a new instance of
assumption.AtomicIntegerAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default AtomicIntegerArrayAssert assumeThat(AtomicIntegerArray actual)
Creates int[] assumption forAtomicIntegerArray
.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT> assumeThat(AtomicIntegerFieldUpdater<OBJECT> actual)
Creates a new instance of
assumption.AtomicIntegerFieldUpdaterAssert
- Type Parameters:
OBJECT
- the type of the object holding the updatable field.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default LongAdderAssert assumeThat(LongAdder actual)
Creates a new instance of
assumption.LongAdderAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default AtomicLongAssert assumeThat(AtomicLong actual)
Creates a new instance of
assumption.AtomicLongAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default AtomicLongArrayAssert assumeThat(AtomicLongArray actual)
Creates a new instance of
assumption.AtomicLongArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> assumeThat(AtomicLongFieldUpdater<OBJECT> actual)
Creates a new instance of
assumption.AtomicLongFieldUpdaterAssert
- Type Parameters:
OBJECT
- the type of the object holding the updatable field.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <VALUE> AtomicReferenceAssert<VALUE> assumeThat(AtomicReference<VALUE> actual)
Creates a new instance of
assumption.AtomicReferenceAssert
- Type Parameters:
VALUE
- the type of the value contained in theAtomicReference
.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <ELEMENT> AtomicReferenceArrayAssert<ELEMENT> assumeThat(AtomicReferenceArray<ELEMENT> actual)
Creates a new instance of
assumption.AtomicReferenceArrayAssert
- Type Parameters:
ELEMENT
- the type of the value contained in theAtomicReferenceArray
.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <FIELD,OBJECT> AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> assumeThat(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
Creates a new instance of
assumption.AtomicReferenceFieldUpdaterAssert
- Type Parameters:
FIELD
- the type of the field which gets updated by theAtomicReferenceFieldUpdater
.OBJECT
- the type of the object holding the updatable field.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <VALUE> AtomicMarkableReferenceAssert<VALUE> assumeThat(AtomicMarkableReference<VALUE> actual)
Creates a new instance of
assumption.AtomicMarkableReferenceAssert
- Type Parameters:
VALUE
- the type of the value contained in theAtomicMarkableReference
.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <VALUE> AtomicStampedReferenceAssert<VALUE> assumeThat(AtomicStampedReference<VALUE> actual)
Creates a new instance of
assumption.AtomicStampedReferenceAssert
- Type Parameters:
VALUE
- the type of the value contained in theAtomicStampedReference
.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default CharSequenceAssert assumeThat(CharSequence actual)
Creates a new instance of
assumption.CharSequenceAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default CharSequenceAssert assumeThat(StringBuilder actual)
Creates a new instance of
assumption from aCharSequenceAssert
StringBuilder
.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.11.0
-
assumeThat
default CharSequenceAssert assumeThat(StringBuffer actual)
Creates a new instance of
assumption from aCharSequenceAssert
StringBuffer
.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.11.0
-
assumeThat
default ShortArrayAssert assumeThat(short[] actual)
Creates a new instance of
assumption.ShortArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Short2DArrayAssert assumeThat(short[][] actual)
Creates a new instance of
assumption.Short2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default ShortAssert assumeThat(Short actual)
Creates a new instance of
assumption.ShortAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ClassAssert assumeThat(Class<?> actual)
Creates a new instance of
assumption.ClassAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default CharacterAssert assumeThat(Character actual)
Creates a new instance of
assumption.CharacterAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default CharArrayAssert assumeThat(char[] actual)
Creates a new instance of
assumption.CharArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Char2DArrayAssert assumeThat(char[][] actual)
Creates a new instance of
assumption.Char2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default CharacterAssert assumeThat(char actual)
Creates a new instance of
assumption.CharacterAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <T extends Comparable<? super T>> GenericComparableAssert<T> assumeThat(T actual)
Creates a new instance of
assumption.GenericComparableAssert
- Type Parameters:
T
- the type of actual.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> IterableAssert<ELEMENT> assumeThat(Iterable<? extends ELEMENT> actual)
Creates a new instance of
assumption.IterableAssert
- Type Parameters:
ELEMENT
- the type of elements.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> IteratorAssert<ELEMENT> assumeThat(Iterator<? extends ELEMENT> actual)
Creates a new instance of
assumption.IteratorAssert
Breaking change in version 3.12.0: this method does not return anymore an
IterableAssert
but anIteratorAssert
.- Type Parameters:
ELEMENT
- the type of elements.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default BooleanAssert assumeThat(Boolean actual)
Creates a new instance of
assumption.BooleanAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default BooleanArrayAssert assumeThat(boolean[] actual)
Creates a new instance of
assumption.BooleanArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Boolean2DArrayAssert assumeThat(boolean[][] actual)
Creates a new instance of
assumption.Boolean2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default ByteAssert assumeThat(byte actual)
Creates a new instance of
assumption.ByteAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ByteAssert assumeThat(Byte actual)
Creates a new instance of
assumption.ByteAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ByteArrayAssert assumeThat(byte[] actual)
Creates a new instance of
assumption.ByteArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Byte2DArrayAssert assumeThat(byte[][] actual)
Creates a new instance of
assumption.Byte2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default BooleanAssert assumeThat(boolean actual)
Creates a new instance of
assumption.BooleanAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default FloatAssert assumeThat(float actual)
Creates a new instance of
assumption.FloatAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default InputStreamAssert assumeThat(InputStream actual)
Creates a new instance of
assumption.InputStreamAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default FileAssert assumeThat(File actual)
Creates a new instance of
assumption.FileAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <RESULT> FutureAssert<RESULT> assumeThat(Future<RESULT> actual)
Create assertion forFutureAssert
assumption.- Type Parameters:
RESULT
- the type of the value contained in theFuture
.- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default PathAssert assumeThat(Path actual)
Creates a new instance of
assumption.PathAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default IntArrayAssert assumeThat(int[] actual)
Creates a new instance of
assumption.IntArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Int2DArrayAssert assumeThat(int[][] actual)
Creates a new instance of
assumption.Int2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default FloatAssert assumeThat(Float actual)
Creates a new instance of
assumption.FloatAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Float2DArrayAssert assumeThat(float[][] actual)
Creates a new instance of
assumption.Float2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default IntegerAssert assumeThat(int actual)
Creates a new instance of
assumption.IntegerAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default FloatArrayAssert assumeThat(float[] actual)
Creates a new instance of
assumption.FloatArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default IntegerAssert assumeThat(Integer actual)
Creates a new instance of
assumption.IntegerAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default DoubleAssert assumeThat(double actual)
Creates a new instance of
assumption.DoubleAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default DoubleAssert assumeThat(Double actual)
Creates a new instance of
assumption.DoubleAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> ListAssert<ELEMENT> assumeThat(List<? extends ELEMENT> list)
Creates a new instance of
assumption.ListAssert
- Type Parameters:
ELEMENT
- the type of elements.- Parameters:
list
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> ListAssert<ELEMENT> assumeThat(Stream<? extends ELEMENT> stream)
Creates a new instance of
assumption from the givenListAssert
Stream
.- Type Parameters:
ELEMENT
- the type of elements.- Parameters:
stream
- the Stream to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default ListAssert<Double> assumeThat(DoubleStream doubleStream)
Creates a new instance of
assumption from the givenListAssert
DoubleStream
.- Parameters:
doubleStream
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ListAssert<Long> assumeThat(LongStream longStream)
Creates a new instance of
assumption from the givenListAssert
LongStream
.- Parameters:
longStream
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default ListAssert<Integer> assumeThat(IntStream intStream)
Creates a new instance of
assumption from the givenListAssert
IntStream
.- Parameters:
intStream
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default DoubleArrayAssert assumeThat(double[] actual)
Creates a new instance of
assumption.DoubleArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default Double2DArrayAssert assumeThat(double[][] actual)
Creates a new instance of
assumption.Double2DArrayAssert
- Parameters:
actual
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default ZonedDateTimeAssert assumeThat(ZonedDateTime zonedDateTime)
Creates a new instance of
assumption.ZonedDateTimeAssert
- Parameters:
zonedDateTime
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default <RESULT> CompletableFutureAssert<RESULT> assumeThat(CompletableFuture<RESULT> future)
Creates a new instance ofCompletableFutureAssert
assumption.- Type Parameters:
RESULT
- the CompletableFuture wrapped type.- Parameters:
future
- the CompletableFuture to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default <RESULT> CompletableFutureAssert<RESULT> assumeThat(CompletionStage<RESULT> actual)
Creates a new instance ofCompletableFutureAssert
assumption for aCompletionStage
by converting it to aCompletableFuture
and returning aCompletableFutureAssert
.If the given
CompletionStage
is null, theCompletableFuture
in the returnedCompletableFutureAssert
will also be null.- Type Parameters:
RESULT
- the CompletableFuture wrapped type.- Parameters:
actual
- the CompletableFuture to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default <VALUE> OptionalAssert<VALUE> assumeThat(Optional<VALUE> optional)
Creates a new instance ofOptionalAssert
assumption.- Type Parameters:
VALUE
- the Optional wrapped type.- Parameters:
optional
- the Optional to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default OptionalDoubleAssert assumeThat(OptionalDouble optionalDouble)
Creates a new instance of
assumption.OptionalDoubleAssert
- Parameters:
optionalDouble
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default OptionalIntAssert assumeThat(OptionalInt optionalInt)
Creates a new instance of
assumption.OptionalIntAssert
- Parameters:
optionalInt
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default OptionalLongAssert assumeThat(OptionalLong optionalLong)
Creates a new instance of
assumption.OptionalLongAssert
- Parameters:
optionalLong
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LocalDateTimeAssert assumeThat(LocalDateTime localDateTime)
Creates a new instance of
assumption.LocalDateTimeAssert
- Parameters:
localDateTime
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LocalDateAssert assumeThat(LocalDate localDate)
Creates a new instance of
assumption.LocalDateAssert
- Parameters:
localDate
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default LocalTimeAssert assumeThat(LocalTime localTime)
Creates a new instance of
assumption.LocalTimeAssert
- Parameters:
localTime
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default InstantAssert assumeThat(Instant instant)
Creates a new instance of
assumption.InstantAssert
- Parameters:
instant
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default DurationAssert assumeThat(Duration duration)
Creates a new instance of
assumption.DurationAssert
- Parameters:
duration
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.15.0
-
assumeThat
default PeriodAssert assumeThat(Period period)
Creates a new instance of
assumption.PeriodAssert
- Parameters:
period
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.17.0
-
assumeThat
default OffsetTimeAssert assumeThat(OffsetTime offsetTime)
Creates a new instance of
assumption.OffsetTimeAssert
- Parameters:
offsetTime
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default OffsetDateTimeAssert assumeThat(OffsetDateTime offsetDateTime)
Creates a new instance of
assumption.OffsetDateTimeAssert
- Parameters:
offsetDateTime
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThatThrownBy
default ThrowableAssert assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assume on aThrowable
(easier done with lambdas).Example :
@Test public void testException() { assumeThatThrownBy(() -> { throw new Exception("boom!") }).isInstanceOf(Exception.class) .hasMessageContaining("boom"); }
- Parameters:
shouldRaiseThrowable
- TheThrowableAssert.ThrowingCallable
or lambda with the code that should raise the throwable.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThatCode
default ThrowableAssert assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assume on aThrowable
(easier done with lambdas).Example :
ThrowingCallable callable = () -> { throw new Exception("boom!"); }; // assertion succeeds assumeThatCode(callable).isInstanceOf(Exception.class) .hasMessageContaining("boom"); // assertion fails assumeThatCode(callable).doesNotThrowAnyException();
This method was not named
assumeThat
because the java compiler reported it ambiguous when used directly with a lambda :(- Parameters:
shouldRaiseOrNotThrowable
- TheThrowableAssert.ThrowingCallable
or lambda with the code that should raise the throwable.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThatObject
default <T> ObjectAssert<T> assumeThatObject(T actual)
Creates a new instance of
for any object.ObjectAssert
This overload is useful, when an overloaded method of assertThat(...) takes precedence over the generic
assumeThat(Object)
.Example:
Cast necessary because
assumeThat(List)
"forgets" actual type:
No cast needed, but also no additional list assertions:assumeThat(new LinkedList<>(asList("abc"))).matches(list -> ((Deque<String>) list).getFirst().equals("abc"));
assumeThatObject(new LinkedList<>(asList("abc"))).matches(list -> list.getFirst().equals("abc"));
- Type Parameters:
T
- the type of the actual value.- Parameters:
actual
- the actual value.- Returns:
- the created assertion object.
- Since:
- 3.12.0
-
assumeThat
default <T> PredicateAssert<T> assumeThat(Predicate<T> predicate)
Creates a new instance ofPredicateAssert
assumption.- Type Parameters:
T
- thePredicate
type.- Parameters:
predicate
- the Predicate to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default IntPredicateAssert assumeThat(IntPredicate intPredicate)
Creates a new instance ofIntPredicateAssert
assumption.- Parameters:
intPredicate
- the IntPredicate to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default LongPredicateAssert assumeThat(LongPredicate longPredicate)
Creates a new instance ofLongPredicateAssert
assumption.- Parameters:
longPredicate
- the LongPredicate to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default DoublePredicateAssert assumeThat(DoublePredicate doublePredicate)
Creates a new instance ofDoublePredicateAssert
assumption.- Parameters:
doublePredicate
- the DoublePredicate to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default UrlAssert assumeThat(URL url)
Creates a new instance of
assumption.UrlAssert
- Parameters:
url
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default UriAssert assumeThat(URI uri)
Creates a new instance of
assumption.UriAssert
- Parameters:
uri
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> SpliteratorAssert<ELEMENT> assumeThat(Spliterator<ELEMENT> spliterator)
Creates a new instance of
assumption.SpliteratorAssert
- Type Parameters:
ELEMENT
- the type of the elements.- Parameters:
spliterator
- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.14.0
-
-