Package org.assertj.core.api
Interface WithAssumptions
-
public interface WithAssumptionsA 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 AbstractBooleanAssert<?>assumeThat(boolean actual)Creates a new instance ofassumption.BooleanAssertdefault AbstractBooleanArrayAssert<?>assumeThat(boolean[] actual)Creates a new instance ofassumption.BooleanArrayAssertdefault AbstractByteAssert<?>assumeThat(byte actual)Creates a new instance ofassumption.ByteAssertdefault AbstractByteArrayAssert<?>assumeThat(byte[] actual)Creates a new instance ofassumption.ByteArrayAssertdefault AbstractCharacterAssert<?>assumeThat(char actual)Creates a new instance ofassumption.CharacterAssertdefault AbstractCharArrayAssert<?>assumeThat(char[] actual)Creates a new instance ofassumption.CharArrayAssertdefault AbstractDoubleAssert<?>assumeThat(double actual)Creates a new instance ofassumption.DoubleAssertdefault AbstractDoubleArrayAssert<?>assumeThat(double[] actual)Creates a new instance ofassumption.DoubleArrayAssertdefault AbstractFloatAssert<?>assumeThat(float actual)Creates a new instance ofassumption.FloatAssertdefault AbstractFloatArrayAssert<?>assumeThat(float[] actual)Creates a new instance ofassumption.FloatArrayAssertdefault AbstractIntegerAssert<?>assumeThat(int actual)Creates a new instance ofassumption.IntegerAssertdefault AbstractIntArrayAssert<?>assumeThat(int[] actual)Creates a new instance ofassumption.IntArrayAssertdefault AbstractLongAssert<?>assumeThat(long actual)Creates a new instance ofassumption.LongAssertdefault AbstractLongArrayAssert<?>assumeThat(long[] actual)Creates a new instance ofassumption.LongArrayAssertdefault AbstractShortAssert<?>assumeThat(short actual)Creates a new instance ofassumption.ShortAssertdefault AbstractShortArrayAssert<?>assumeThat(short[] actual)Creates a new instance ofassumption.ShortArrayAssertdefault AbstractFileAssert<?>assumeThat(File actual)Creates a new instance ofassumption.FileAssertdefault AbstractInputStreamAssert<?,? extends InputStream>assumeThat(InputStream actual)Creates a new instance ofassumption.InputStreamAssertdefault AbstractBooleanAssert<?>assumeThat(Boolean actual)Creates a new instance ofassumption.BooleanAssertdefault AbstractByteAssert<?>assumeThat(Byte actual)Creates a new instance ofassumption.ByteAssertdefault AbstractCharacterAssert<?>assumeThat(Character actual)Creates a new instance ofassumption.CharacterAssertdefault AbstractCharSequenceAssert<?,? extends CharSequence>assumeThat(CharSequence actual)Creates a new instance ofassumption.CharSequenceAssertdefault AbstractClassAssert<?>assumeThat(Class<?> actual)Creates a new instance ofassumption.CharSequenceAssertdefault AbstractDoubleAssert<?>assumeThat(Double actual)Creates a new instance ofassumption.DoubleAssertdefault AbstractFloatAssert<?>assumeThat(Float actual)Creates a new instance ofassumption.FloatAssertdefault AbstractIntegerAssert<?>assumeThat(Integer actual)Creates a new instance ofassumption.IntegerAssertdefault <ELEMENT> ProxyableIterableAssert<ELEMENT>assumeThat(Iterable<? extends ELEMENT> actual)Creates a new instance ofassumption.IterableAssertdefault AbstractLongAssert<?>assumeThat(Long actual)Creates a new instance ofassumption.LongAssertdefault AbstractShortAssert<?>assumeThat(Short actual)Creates a new instance ofassumption.ShortAssertdefault AbstractStringAssert<?>assumeThat(String actual)Creates a new instance ofassumption.StringAssertdefault AbstractCharSequenceAssert<?,? extends CharSequence>assumeThat(StringBuffer actual)Creates a new instance ofassumption from aCharSequenceAssertStringBuffer.default AbstractCharSequenceAssert<?,? extends CharSequence>assumeThat(StringBuilder actual)Creates a new instance ofassumption from aCharSequenceAssertStringBuilder.default AbstractThrowableAssert<?,? extends Throwable>assumeThat(Throwable actual)Creates a new instance ofassumption.ThrowableAssertdefault AbstractBigDecimalAssert<?>assumeThat(BigDecimal actual)Creates a new instance ofassumption.BigDecimalAssertdefault AbstractBigIntegerAssert<?>assumeThat(BigInteger actual)Creates a new instance ofassumption.BigIntegerAssertdefault AbstractUriAssert<?>assumeThat(URI uri)Creates a new instance ofassumption.UriAssertdefault AbstractUrlAssert<?>assumeThat(URL url)Creates a new instance ofassumption.UrlAssertdefault AbstractPathAssert<?>assumeThat(Path actual)Creates a new instance ofassumption.PathAssertdefault AbstractInstantAssert<?>assumeThat(Instant instant)Creates a new instance ofassumption.InstantAssertdefault AbstractLocalDateAssert<?>assumeThat(LocalDate localDate)Creates a new instance ofassumption.LocalDateAssertdefault AbstractLocalDateTimeAssert<?>assumeThat(LocalDateTime localDateTime)Creates a new instance ofassumption.LocalDateTimeAssertdefault AbstractLocalTimeAssert<?>assumeThat(LocalTime localTime)Creates a new instance ofassumption.LocalTimeAssertdefault AbstractOffsetDateTimeAssert<?>assumeThat(OffsetDateTime offsetDateTime)Creates a new instance ofassumption.OffsetDateTimeAssertdefault AbstractOffsetTimeAssert<?>assumeThat(OffsetTime offsetTime)Creates a new instance ofassumption.OffsetTimeAssertdefault AbstractZonedDateTimeAssert<?>assumeThat(ZonedDateTime zonedDateTime)Creates a new instance ofassumption.ZonedDateTimeAssertdefault AtomicBooleanAssertassumeThat(AtomicBoolean actual)Creates a new instance ofassumption.AtomicBooleanAssertdefault AtomicIntegerAssertassumeThat(AtomicInteger actual)Creates a new instance ofassumption.AtomicIntegerAssertdefault AtomicIntegerArrayAssertassumeThat(AtomicIntegerArray actual)Creates int[] assumption forAtomicIntegerArray.default <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT>assumeThat(AtomicIntegerFieldUpdater<OBJECT> actual)Creates a new instance ofassumption.AtomicIntegerFieldUpdaterAssertdefault AtomicLongAssertassumeThat(AtomicLong actual)Creates a new instance ofassumption.AtomicLongAssertdefault AtomicLongArrayAssertassumeThat(AtomicLongArray actual)Creates a new instance ofassumption.AtomicLongArrayAssertdefault <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT>assumeThat(AtomicLongFieldUpdater<OBJECT> actual)Creates a new instance ofassumption.AtomicLongFieldUpdaterAssertdefault <VALUE> AtomicMarkableReferenceAssert<VALUE>assumeThat(AtomicMarkableReference<VALUE> actual)Creates a new instance ofassumption.AtomicMarkableReferenceAssertdefault <VALUE> AtomicReferenceAssert<VALUE>assumeThat(AtomicReference<VALUE> actual)Creates a new instance ofassumption.AtomicReferenceAssertdefault <ELEMENT> AtomicReferenceArrayAssert<ELEMENT>assumeThat(AtomicReferenceArray<ELEMENT> actual)Creates a new instance ofassumption.AtomicReferenceArrayAssertdefault <FIELD,OBJECT>
AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT>assumeThat(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)Creates a new instance ofassumption.AtomicReferenceFieldUpdaterAssertdefault <VALUE> AtomicStampedReferenceAssert<VALUE>assumeThat(AtomicStampedReference<VALUE> actual)Creates a new instance ofassumption.AtomicStampedReferenceAssertdefault <RESULT> CompletableFutureAssert<RESULT>assumeThat(CompletableFuture<RESULT> future)Creates a new instance ofCompletableFutureAssertassumption.default <RESULT> CompletableFutureAssert<RESULT>assumeThat(CompletionStage<RESULT> actual)Creates a new instance ofCompletableFutureAssertassumption for aCompletionStageby converting it to aCompletableFutureand returning aCompletableFutureAssert.default <RESULT> AbstractFutureAssert<?,? extends Future<? extends RESULT>,RESULT>assumeThat(Future<RESULT> actual)Create assertion forFutureAssertassumption.default AbstractDateAssert<?>assumeThat(Date actual)Creates a new instance ofassumption.DateAssertdefault DoublePredicateAssertassumeThat(DoublePredicate doublePredicate)Creates a new instance ofDoublePredicateAssertassumption.default IntPredicateAssertassumeThat(IntPredicate intPredicate)Creates a new instance ofIntPredicateAssertassumption.default LongPredicateAssertassumeThat(LongPredicate longPredicate)Creates a new instance ofLongPredicateAssertassumption.default <T> ProxyablePredicateAssert<T>assumeThat(Predicate<T> predicate)Creates a new instance ofPredicateAssertassumption.default <ELEMENT> IteratorAssert<ELEMENT>assumeThat(Iterator<? extends ELEMENT> actual)Creates a new instance ofassumption.IteratorAssertdefault <ELEMENT> FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>assumeThat(List<? extends ELEMENT> list)Creates a new instance ofassumption.ListAssertdefault <K,V>
AbstractMapAssert<?,?,K,V>assumeThat(Map<K,V> actual)Creates a new instance ofassumption.MapAssertdefault <VALUE> OptionalAssert<VALUE>assumeThat(Optional<VALUE> optional)Creates a new instance ofOptionalAssertassumption.default OptionalDoubleAssertassumeThat(OptionalDouble optionalDouble)Creates a new instance ofassumption.OptionalDoubleAssertdefault OptionalIntAssertassumeThat(OptionalInt optionalInt)Creates a new instance ofassumption.OptionalIntAssertdefault OptionalLongAssertassumeThat(OptionalLong optionalLong)Creates a new instance ofassumption.OptionalLongAssertdefault AbstractListAssert<?,List<? extends Double>,Double,ObjectAssert<Double>>assumeThat(DoubleStream doubleStream)Creates a new instance ofassumption from the givenListAssertDoubleStream.default AbstractListAssert<?,List<? extends Integer>,Integer,ObjectAssert<Integer>>assumeThat(IntStream intStream)Creates a new instance ofassumption from the givenListAssertIntStream.default AbstractListAssert<?,List<? extends Long>,Long,ObjectAssert<Long>>assumeThat(LongStream longStream)Creates a new instance ofassumption from the givenListAssertLongStream.default <ELEMENT> AbstractListAssert<?,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>assumeThat(Stream<? extends ELEMENT> stream)Creates a new instance ofassumption from the givenListAssertStream.default <T> ProxyableObjectAssert<T>assumeThat(T actual)Creates a new instance ofassumption.ObjectAssertdefault <T> ProxyableObjectArrayAssert<T>assumeThat(T[] actual)Creates a new instance ofassumption.ObjectArrayAssertdefault AbstractThrowableAssert<?,? extends Throwable>assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)Allows to capture and then assume on aThrowable(easier done with lambdas).default <T> ProxyableObjectAssert<T>assumeThatObject(T actual)Creates a new instance offor any object.ObjectAssertdefault AbstractThrowableAssert<?,? extends Throwable>assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)Allows to capture and then assume on aThrowable(easier done with lambdas).
-
-
-
Method Detail
-
assumeThat
default <T> ProxyableObjectArrayAssert<T> assumeThat(T[] actual)
Creates a new instance ofassumption.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 <K,V> AbstractMapAssert<?,?,K,V> assumeThat(Map<K,V> actual)
Creates a new instance ofassumption.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 AbstractShortAssert<?> assumeThat(short actual)
Creates a new instance ofassumption.ShortAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLongAssert<?> assumeThat(long actual)
Creates a new instance ofassumption.LongAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLongAssert<?> assumeThat(Long actual)
Creates a new instance ofassumption.LongAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLongArrayAssert<?> assumeThat(long[] actual)
Creates a new instance ofassumption.LongArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <T> ProxyableObjectAssert<T> assumeThat(T actual)
Creates a new instance ofassumption.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 AbstractStringAssert<?> assumeThat(String actual)
Creates a new instance ofassumption.StringAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractDateAssert<?> assumeThat(Date actual)
Creates a new instance ofassumption.DateAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractThrowableAssert<?,? extends Throwable> assumeThat(Throwable actual)
Creates a new instance ofassumption.ThrowableAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractBigDecimalAssert<?> assumeThat(BigDecimal actual)
Creates a new instance ofassumption.BigDecimalAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractBigIntegerAssert<?> assumeThat(BigInteger actual)
Creates a new instance ofassumption.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 ofassumption.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 ofassumption.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 ofassumption.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 AtomicLongAssert assumeThat(AtomicLong actual)
Creates a new instance ofassumption.AtomicLongAssert- Parameters:
actual- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default AtomicLongArrayAssert assumeThat(AtomicLongArray actual)
Creates a new instance ofassumption.AtomicLongArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> assumeThat(AtomicLongFieldUpdater<OBJECT> actual)
Creates a new instance ofassumption.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 ofassumption.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 ofassumption.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 ofassumption.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 ofassumption.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 ofassumption.AtomicStampedReferenceAssert- Type Parameters:
VALUE- the type of the value contained in theAtomicStampedReference.- Parameters:
actual- the actual value.- Returns:
- the created assertion object.
-
assumeThat
default AbstractCharSequenceAssert<?,? extends CharSequence> assumeThat(CharSequence actual)
Creates a new instance ofassumption.CharSequenceAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractCharSequenceAssert<?,? extends CharSequence> assumeThat(StringBuilder actual)
Creates a new instance ofassumption from aCharSequenceAssertStringBuilder.- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.11.0
-
assumeThat
default AbstractCharSequenceAssert<?,? extends CharSequence> assumeThat(StringBuffer actual)
Creates a new instance ofassumption from aCharSequenceAssertStringBuffer.- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 3.11.0
-
assumeThat
default AbstractShortArrayAssert<?> assumeThat(short[] actual)
Creates a new instance ofassumption.ShortArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractShortAssert<?> assumeThat(Short actual)
Creates a new instance ofassumption.ShortAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractClassAssert<?> assumeThat(Class<?> actual)
Creates a new instance ofassumption.CharSequenceAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractCharacterAssert<?> assumeThat(Character actual)
Creates a new instance ofassumption.CharacterAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractCharArrayAssert<?> assumeThat(char[] actual)
Creates a new instance ofassumption.CharArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractCharacterAssert<?> assumeThat(char actual)
Creates a new instance ofassumption.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>> AbstractComparableAssert<?,T> assumeThat(T actual)
Creates a new instance ofassumption.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> ProxyableIterableAssert<ELEMENT> assumeThat(Iterable<? extends ELEMENT> actual)
Creates a new instance ofassumption.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 ofassumption.IteratorAssertBreaking change in version 3.12.0: this method does not return anymore an
ProxyableIterableAssertbut 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 AbstractBooleanAssert<?> assumeThat(Boolean actual)
Creates a new instance ofassumption.BooleanAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractBooleanArrayAssert<?> assumeThat(boolean[] actual)
Creates a new instance ofassumption.BooleanArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractByteAssert<?> assumeThat(byte actual)
Creates a new instance ofassumption.ByteAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractByteAssert<?> assumeThat(Byte actual)
Creates a new instance ofassumption.ByteAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractByteArrayAssert<?> assumeThat(byte[] actual)
Creates a new instance ofassumption.ByteArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractBooleanAssert<?> assumeThat(boolean actual)
Creates a new instance ofassumption.BooleanAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractFloatAssert<?> assumeThat(float actual)
Creates a new instance ofassumption.FloatAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractInputStreamAssert<?,? extends InputStream> assumeThat(InputStream actual)
Creates a new instance ofassumption.InputStreamAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractFileAssert<?> assumeThat(File actual)
Creates a new instance ofassumption.FileAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <RESULT> AbstractFutureAssert<?,? extends Future<? extends RESULT>,RESULT> assumeThat(Future<RESULT> actual)
Create assertion forFutureAssertassumption.- 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 AbstractPathAssert<?> assumeThat(Path actual)
Creates a new instance ofassumption.PathAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractIntArrayAssert<?> assumeThat(int[] actual)
Creates a new instance ofassumption.IntArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractFloatAssert<?> assumeThat(Float actual)
Creates a new instance ofassumption.FloatAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractIntegerAssert<?> assumeThat(int actual)
Creates a new instance ofassumption.IntegerAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractFloatArrayAssert<?> assumeThat(float[] actual)
Creates a new instance ofassumption.FloatArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractIntegerAssert<?> assumeThat(Integer actual)
Creates a new instance ofassumption.IntegerAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractDoubleAssert<?> assumeThat(double actual)
Creates a new instance ofassumption.DoubleAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractDoubleAssert<?> assumeThat(Double actual)
Creates a new instance ofassumption.DoubleAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default <ELEMENT> FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> assumeThat(List<? extends ELEMENT> list)
Creates a new instance ofassumption.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> AbstractListAssert<?,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> assumeThat(Stream<? extends ELEMENT> stream)
Creates a new instance ofassumption from the givenListAssertStream.- 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 AbstractListAssert<?,List<? extends Double>,Double,ObjectAssert<Double>> assumeThat(DoubleStream doubleStream)
Creates a new instance ofassumption from the givenListAssertDoubleStream.- Parameters:
doubleStream- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractListAssert<?,List<? extends Long>,Long,ObjectAssert<Long>> assumeThat(LongStream longStream)
Creates a new instance ofassumption from the givenListAssertLongStream.- Parameters:
longStream- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractListAssert<?,List<? extends Integer>,Integer,ObjectAssert<Integer>> assumeThat(IntStream intStream)
Creates a new instance ofassumption from the givenListAssertIntStream.- Parameters:
intStream- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractDoubleArrayAssert<?> assumeThat(double[] actual)
Creates a new instance ofassumption.DoubleArrayAssert- Parameters:
actual- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractZonedDateTimeAssert<?> assumeThat(ZonedDateTime zonedDateTime)
Creates a new instance ofassumption.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 ofCompletableFutureAssertassumption.- 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 ofCompletableFutureAssertassumption for aCompletionStageby converting it to aCompletableFutureand returning aCompletableFutureAssert.If the given
CompletionStageis null, theCompletableFuturein the returnedCompletableFutureAssertwill 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 ofOptionalAssertassumption.- 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 ofassumption.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 ofassumption.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 ofassumption.OptionalLongAssert- Parameters:
optionalLong- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLocalDateTimeAssert<?> assumeThat(LocalDateTime localDateTime)
Creates a new instance ofassumption.LocalDateTimeAssert- Parameters:
localDateTime- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLocalDateAssert<?> assumeThat(LocalDate localDate)
Creates a new instance ofassumption.LocalDateAssert- Parameters:
localDate- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractLocalTimeAssert<?> assumeThat(LocalTime localTime)
Creates a new instance ofassumption.LocalTimeAssert- Parameters:
localTime- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractInstantAssert<?> assumeThat(Instant instant)
Creates a new instance ofassumption.InstantAssert- Parameters:
instant- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractOffsetTimeAssert<?> assumeThat(OffsetTime offsetTime)
Creates a new instance ofassumption.OffsetTimeAssert- Parameters:
offsetTime- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractOffsetDateTimeAssert<?> assumeThat(OffsetDateTime offsetDateTime)
Creates a new instance ofassumption.OffsetDateTimeAssert- Parameters:
offsetDateTime- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThatThrownBy
default AbstractThrowableAssert<?,? extends Throwable> 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.ThrowingCallableor 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 AbstractThrowableAssert<?,? extends Throwable> 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
assumeThatbecause the java compiler reported it ambiguous when used directly with a lambda :(- Parameters:
shouldRaiseOrNotThrowable- TheThrowableAssert.ThrowingCallableor 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> ProxyableObjectAssert<T> assumeThatObject(T actual)
Creates a new instance offor any object.ObjectAssertThis 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> ProxyablePredicateAssert<T> assumeThat(Predicate<T> predicate)
Creates a new instance ofPredicateAssertassumption.- Type Parameters:
T- thePredicatetype.- 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 ofIntPredicateAssertassumption.- 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 ofLongPredicateAssertassumption.- 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 ofDoublePredicateAssertassumption.- Parameters:
doublePredicate- the DoublePredicate to test- Returns:
- the created assumption for assertion object.
- Since:
- 3.9.0
-
assumeThat
default AbstractUrlAssert<?> assumeThat(URL url)
Creates a new instance ofassumption.UrlAssert- Parameters:
url- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
assumeThat
default AbstractUriAssert<?> assumeThat(URI uri)
Creates a new instance ofassumption.UriAssert- Parameters:
uri- the actual value.- Returns:
- the created assumption for assertion object.
- Since:
- 2.9.0 / 3.9.0
-
-