public class Assumptions extends Object
| Constructor and Description |
|---|
Assumptions() |
| Modifier and Type | Method and Description |
|---|---|
static AtomicBooleanAssert |
assumeThat(AtomicBoolean actual)
Create assumption for
AtomicBoolean. |
static AtomicIntegerAssert |
assumeThat(AtomicInteger actual)
Create assumption for
AtomicInteger. |
static AtomicIntegerArrayAssert |
assumeThat(AtomicIntegerArray actual)
Creates int[] assumption for
AtomicIntegerArray. |
static <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT> |
assumeThat(AtomicIntegerFieldUpdater<OBJECT> actual)
Create assumption for
AtomicIntegerFieldUpdater. |
static AtomicLongAssert |
assumeThat(AtomicLong actual)
Create assumption for
AtomicLong. |
static AtomicLongArrayAssert |
assumeThat(AtomicLongArray actual)
Create assumption for
AtomicLongArray. |
static <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> |
assumeThat(AtomicLongFieldUpdater<OBJECT> actual)
Create assumption for
AtomicLongFieldUpdater. |
static <VALUE> AtomicMarkableReferenceAssert<VALUE> |
assumeThat(AtomicMarkableReference<VALUE> actual)
Create assumption for
AtomicMarkableReference. |
static <VALUE> AtomicReferenceAssert<VALUE> |
assumeThat(AtomicReference<VALUE> actual)
Create assumption for
AtomicReference. |
static <ELEMENT> AtomicReferenceArrayAssert<ELEMENT> |
assumeThat(AtomicReferenceArray<ELEMENT> actual)
Create assumption for
AtomicReferenceArray. |
static <FIELD,OBJECT> |
assumeThat(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
Create assumption for
AtomicReferenceFieldUpdater. |
static <VALUE> AtomicStampedReferenceAssert<VALUE> |
assumeThat(AtomicStampedReference<VALUE> actual)
Create assumption for
AtomicStampedReference. |
static AbstractBigDecimalAssert<?> |
assumeThat(BigDecimal actual)
Creates a new instance of
assumption. |
static AbstractBigIntegerAssert<?> |
assumeThat(BigInteger actual)
Creates a new instance of
assumption. |
static AbstractBooleanAssert<?> |
assumeThat(boolean actual)
Creates a new instance of
assumption. |
static AbstractBooleanAssert<?> |
assumeThat(Boolean actual)
Creates a new instance of
assumption. |
static AbstractBooleanArrayAssert<?> |
assumeThat(boolean[] actual)
Creates a new instance of
assumption. |
static AbstractByteAssert<?> |
assumeThat(byte actual)
Creates a new instance of
assumption. |
static AbstractByteAssert<?> |
assumeThat(Byte actual)
Creates a new instance of
assumption. |
static AbstractByteArrayAssert<?> |
assumeThat(byte[] actual)
Creates a new instance of
assumption. |
static AbstractCharacterAssert<?> |
assumeThat(char actual)
Creates a new instance of
assumption. |
static AbstractCharArrayAssert<?> |
assumeThat(char[] actual)
Creates a new instance of
assumption. |
static AbstractCharacterAssert<?> |
assumeThat(Character actual)
Creates a new instance of
assumption. |
static AbstractCharSequenceAssert<?,? extends CharSequence> |
assumeThat(CharSequence actual)
Creates a new instance of
assumption. |
static AbstractClassAssert<?> |
assumeThat(Class<?> actual)
Creates a new instance of
assumption. |
static <RESULT> CompletableFutureAssert<RESULT> |
assumeThat(CompletableFuture<RESULT> actual)
Creates a new instance of
CompletableFutureAssert assumption. |
static <RESULT> CompletableFutureAssert<RESULT> |
assumeThat(CompletionStage<RESULT> actual)
Creates a new instance of
CompletableFutureAssert assumption for a CompletionStage
by converting it to a CompletableFuture and returning a CompletableFutureAssert. |
static AbstractDateAssert<?> |
assumeThat(Date actual)
Creates a new instance of
assumption. |
static AbstractDoubleAssert<?> |
assumeThat(double actual)
Creates a new instance of
assumption. |
static AbstractDoubleAssert<?> |
assumeThat(Double actual)
Creates a new instance of
assumption. |
static AbstractDoubleArrayAssert<?> |
assumeThat(double[] actual)
Creates a new instance of
assumption. |
static DoublePredicateAssert |
assumeThat(DoublePredicate actual)
Creates a new instance of
DoublePredicateAssert assumption. |
static AbstractListAssert<?,List<? extends Double>,Double,ObjectAssert<Double>> |
assumeThat(DoubleStream actual)
Creates a new instance of
assumption from the given DoubleStream. |
static AbstractFileAssert<?> |
assumeThat(File actual)
Creates a new instance of
assumption. |
static AbstractFloatAssert<?> |
assumeThat(float actual)
Creates a new instance of
assumption. |
static AbstractFloatAssert<?> |
assumeThat(Float actual)
Creates a new instance of
assumption. |
static AbstractFloatArrayAssert<?> |
assumeThat(float[] actual)
Creates a new instance of
assumption. |
static <RESULT> AbstractFutureAssert<?,? extends Future<? extends RESULT>,RESULT> |
assumeThat(Future<RESULT> future)
Create assertion for
FutureAssert assumption. |
static AbstractInputStreamAssert<?,? extends InputStream> |
assumeThat(InputStream actual)
Creates a new instance of
assumption. |
static AbstractInstantAssert<?> |
assumeThat(Instant actual)
Creates a new instance of
InstantAssert assumption. |
static AbstractIntegerAssert<?> |
assumeThat(int actual)
Creates a new instance of
assumption. |
static AbstractIntArrayAssert<?> |
assumeThat(int[] actual)
Creates a new instance of
assumption. |
static AbstractIntegerAssert<?> |
assumeThat(Integer actual)
Creates a new instance of
assumption. |
static IntPredicateAssert |
assumeThat(IntPredicate actual)
Creates a new instance of
IntPredicateAssert assumption. |
static AbstractListAssert<?,List<? extends Integer>,Integer,ObjectAssert<Integer>> |
assumeThat(IntStream actual)
Creates a new instance of
assumption from the given IntStream. |
static <ELEMENT> ProxyableIterableAssert<ELEMENT> |
assumeThat(Iterable<? extends ELEMENT> actual)
Creates a new instance of
assumption. |
static <ELEMENT> ProxyableIterableAssert<ELEMENT> |
assumeThat(Iterator<? extends ELEMENT> actual)
Creates a new instance of
assumption. |
static <ELEMENT> FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> |
assumeThat(List<? extends ELEMENT> actual)
Creates a new instance of
assumption. |
static AbstractLocalDateAssert<?> |
assumeThat(LocalDate actual)
Creates a new instance of
LocalDateAssert assumption. |
static AbstractLocalDateTimeAssert<?> |
assumeThat(LocalDateTime actual)
Creates a new instance of
LocalDateTimeAssert assumption. |
static AbstractLocalTimeAssert<?> |
assumeThat(LocalTime actual)
Creates a new instance of
LocalTimeAssert assumption. |
static AbstractLongAssert<?> |
assumeThat(long actual)
Creates a new instance of
assumption. |
static AbstractLongAssert<?> |
assumeThat(Long actual)
Creates a new instance of
assumption. |
static AbstractLongArrayAssert<?> |
assumeThat(long[] actual)
Creates a new instance of
assumption. |
static LongPredicateAssert |
assumeThat(LongPredicate actual)
Creates a new instance of
LongPredicateAssert assumption. |
static AbstractListAssert<?,List<? extends Long>,Long,ObjectAssert<Long>> |
assumeThat(LongStream actual)
Creates a new instance of
assumption from the given LongStream. |
static <K,V> AbstractMapAssert<?,?,K,V> |
assumeThat(Map<K,V> actual)
Creates a new instance of
assumption. |
static AbstractOffsetDateTimeAssert<?> |
assumeThat(OffsetDateTime actual)
Creates a new instance of
OffsetDateTimeAssert assumption. |
static AbstractOffsetTimeAssert<?> |
assumeThat(OffsetTime actual)
Creates a new instance of
OffsetTimeAssert assumption. |
static <VALUE> OptionalAssert<VALUE> |
assumeThat(Optional<VALUE> actual)
Creates a new instance of
OptionalAssert assumption. |
static OptionalDoubleAssert |
assumeThat(OptionalDouble actual)
Creates a new instance of
OptionalDoubleAssert assumption. |
static OptionalIntAssert |
assumeThat(OptionalInt actual)
Creates a new instance of
OptionalIntAssert assumption. |
static OptionalLongAssert |
assumeThat(OptionalLong actual)
Creates a new instance of
OptionalLongAssert assumption. |
static AbstractPathAssert<?> |
assumeThat(Path actual)
Creates a new instance of
PathAssert assumption. |
static <T> ProxyablePredicateAssert<T> |
assumeThat(Predicate<T> actual)
Creates a new instance of
PredicateAssert assumption. |
static AbstractShortAssert<?> |
assumeThat(short actual)
Creates a new instance of
assumption. |
static AbstractShortAssert<?> |
assumeThat(Short actual)
Creates a new instance of
assumption. |
static AbstractShortArrayAssert<?> |
assumeThat(short[] actual)
Creates a new instance of
assumption. |
static <ELEMENT> AbstractListAssert<?,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> |
assumeThat(Stream<? extends ELEMENT> actual)
Creates a new instance of
assumption from the given Stream. |
static AbstractCharSequenceAssert<?,String> |
assumeThat(String actual)
Creates a new instance of
assumption. |
static <T> ProxyableObjectAssert<T> |
assumeThat(T actual)
Creates a new instance of
assumption. |
static <T extends Comparable<? super T>> |
assumeThat(T actual)
Creates a new instance of
assumption. |
static <T> ProxyableObjectArrayAssert<T> |
assumeThat(T[] actual)
Creates a new instance of
assumption. |
static AbstractThrowableAssert<?,? extends Throwable> |
assumeThat(Throwable actual)
Creates a new instance of
assumption. |
static AbstractUriAssert<?> |
assumeThat(URI actual)
Creates a new instance of
assumption. |
static AbstractUrlAssert<?> |
assumeThat(URL actual)
Creates a new instance of
assumption. |
static AbstractZonedDateTimeAssert<?> |
assumeThat(ZonedDateTime actual)
Creates a new instance of
ZonedDateTimeAssert assumption. |
static AbstractThrowableAssert<?,? extends Throwable> |
assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
static AbstractThrowableAssert<?,? extends Throwable> |
assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
protected static <ASSERTION> |
generateAssumptionClass(Class<ASSERTION> assertionType) |
public static <T> ProxyableObjectAssert<T> assumeThat(T actual)
ObjectAssert assumption.T - the type of the actual value.actual - the actual value.public static AbstractCharSequenceAssert<?,String> assumeThat(String actual)
StringAssert assumption.actual - the actual value.public static AbstractBigDecimalAssert<?> assumeThat(BigDecimal actual)
BigDecimalAssert assumption.actual - the actual value.public static AbstractBigIntegerAssert<?> assumeThat(BigInteger actual)
BigIntegerAssert assumption.actual - the actual value.public static AbstractUriAssert<?> assumeThat(URI actual)
UriAssert assumption.actual - the actual value.public static AbstractUrlAssert<?> assumeThat(URL actual)
UrlAssert assumption.actual - the actual value.public static AbstractBooleanAssert<?> assumeThat(boolean actual)
BooleanAssert assumption.actual - the actual value.public static AbstractBooleanAssert<?> assumeThat(Boolean actual)
BooleanAssert assumption.actual - the actual value.public static AbstractBooleanArrayAssert<?> assumeThat(boolean[] actual)
BooleanArrayAssert assumption.actual - the actual value.public static AbstractByteAssert<?> assumeThat(byte actual)
ByteAssert assumption.actual - the actual value.public static AbstractByteAssert<?> assumeThat(Byte actual)
ByteAssert assumption.actual - the actual value.public static AbstractByteArrayAssert<?> assumeThat(byte[] actual)
ByteArrayAssert assumption.actual - the actual value.public static AbstractCharacterAssert<?> assumeThat(char actual)
CharacterAssert assumption.actual - the actual value.public static AbstractCharacterAssert<?> assumeThat(Character actual)
CharacterAssert assumption.actual - the actual value.public static AbstractCharArrayAssert<?> assumeThat(char[] actual)
CharArrayAssert assumption.actual - the actual value.public static AbstractCharSequenceAssert<?,? extends CharSequence> assumeThat(CharSequence actual)
CharSequenceAssert assumption.actual - the actual value.public static AbstractShortAssert<?> assumeThat(short actual)
ShortAssert assumption.actual - the actual value.public static AbstractShortAssert<?> assumeThat(Short actual)
ShortAssert assumption.actual - the actual value.public static AbstractShortArrayAssert<?> assumeThat(short[] actual)
ShortArrayAssert assumption.actual - the actual value.public static AbstractIntegerAssert<?> assumeThat(int actual)
IntegerAssert assumption.actual - the actual value.public static AbstractIntegerAssert<?> assumeThat(Integer actual)
IntegerAssert assumption.actual - the actual value.public static AbstractIntArrayAssert<?> assumeThat(int[] actual)
IntArrayAssert assumption.actual - the actual value.public static AbstractLongAssert<?> assumeThat(long actual)
LongAssert assumption.actual - the actual value.public static AbstractLongAssert<?> assumeThat(Long actual)
LongAssert assumption.actual - the actual value.public static AbstractLongArrayAssert<?> assumeThat(long[] actual)
LongArrayAssert assumption.actual - the actual value.public static AbstractFloatAssert<?> assumeThat(float actual)
FloatAssert assumption.actual - the actual value.public static AbstractFloatAssert<?> assumeThat(Float actual)
FloatAssert assumption.actual - the actual value.public static AbstractFloatArrayAssert<?> assumeThat(float[] actual)
FloatArrayAssert assumption.actual - the actual value.public static AbstractDoubleAssert<?> assumeThat(double actual)
DoubleAssert assumption.actual - the actual value.public static AbstractDoubleAssert<?> assumeThat(Double actual)
DoubleAssert assumption.actual - the actual value.public static AbstractDoubleArrayAssert<?> assumeThat(double[] actual)
DoubleArrayAssert assumption.actual - the actual value.public static AtomicBooleanAssert assumeThat(AtomicBoolean actual)
AtomicBoolean.actual - the actual value.public static AtomicIntegerAssert assumeThat(AtomicInteger actual)
AtomicInteger.actual - the actual value.public static AtomicIntegerArrayAssert assumeThat(AtomicIntegerArray actual)
AtomicIntegerArray.actual - the actual value.public static <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT> assumeThat(AtomicIntegerFieldUpdater<OBJECT> actual)
AtomicIntegerFieldUpdater.OBJECT - the type of the object holding the updatable field.actual - the actual value.public static AtomicLongAssert assumeThat(AtomicLong actual)
AtomicLong.actual - the actual value.public static AtomicLongArrayAssert assumeThat(AtomicLongArray actual)
AtomicLongArray.actual - the actual value.public static <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> assumeThat(AtomicLongFieldUpdater<OBJECT> actual)
AtomicLongFieldUpdater.OBJECT - the type of the object holding the updatable field.actual - the actual value.public static <VALUE> AtomicReferenceAssert<VALUE> assumeThat(AtomicReference<VALUE> actual)
AtomicReference.VALUE - the type of the value contained in the AtomicReference.actual - the actual value.public static <ELEMENT> AtomicReferenceArrayAssert<ELEMENT> assumeThat(AtomicReferenceArray<ELEMENT> actual)
AtomicReferenceArray.ELEMENT - the type of the value contained in the AtomicReferenceArray.actual - the actual value.public static <FIELD,OBJECT> AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> assumeThat(AtomicReferenceFieldUpdater<OBJECT,FIELD> actual)
AtomicReferenceFieldUpdater.FIELD - the type of the field which gets updated by the AtomicReferenceFieldUpdater.OBJECT - the type of the object holding the updatable field.actual - the actual value.public static <VALUE> AtomicMarkableReferenceAssert<VALUE> assumeThat(AtomicMarkableReference<VALUE> actual)
AtomicMarkableReference.VALUE - the type of the value contained in the AtomicMarkableReference.actual - the actual value.public static <VALUE> AtomicStampedReferenceAssert<VALUE> assumeThat(AtomicStampedReference<VALUE> actual)
AtomicStampedReference.VALUE - the type of the value contained in the AtomicStampedReference.actual - the actual value.public static AbstractClassAssert<?> assumeThat(Class<?> actual)
ClassAssert assumption.actual - the actual value.public static AbstractDateAssert<?> assumeThat(Date actual)
DateAssert assumption.actual - the actual value.public static AbstractFileAssert<?> assumeThat(File actual)
FileAssert assumption.actual - the actual value.public static AbstractPathAssert<?> assumeThat(Path actual)
PathAssert assumption.actual - the path to testpublic static AbstractInputStreamAssert<?,? extends InputStream> assumeThat(InputStream actual)
InputStreamAssert assumption.actual - the actual value.public static <RESULT> AbstractFutureAssert<?,? extends Future<? extends RESULT>,RESULT> assumeThat(Future<RESULT> future)
FutureAssert assumption.RESULT - the type of the value contained in the Future.future - the actual value.public static <ELEMENT> ProxyableIterableAssert<ELEMENT> assumeThat(Iterable<? extends ELEMENT> actual)
IterableAssert assumption.ELEMENT - the type of elements.actual - the actual value.public static <ELEMENT> ProxyableIterableAssert<ELEMENT> assumeThat(Iterator<? extends ELEMENT> actual)
IterableAssert assumption.ELEMENT - the type of elements.actual - the actual value.public static <ELEMENT> FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> assumeThat(List<? extends ELEMENT> actual)
ListAssert assumption.ELEMENT - the type of elements.actual - the actual value.public static <T> ProxyableObjectArrayAssert<T> assumeThat(T[] actual)
ObjectArrayAssert assumption.T - the type of elements.actual - the actual value.public static <K,V> AbstractMapAssert<?,?,K,V> assumeThat(Map<K,V> actual)
MapAssert assumption.K - the type of keys in the map.V - the type of values in the map.actual - the actual value.public static <T extends Comparable<? super T>> AbstractComparableAssert<?,T> assumeThat(T actual)
GenericComparableAssert assumption.T - the type of actual.actual - the actual value.public static AbstractThrowableAssert<?,? extends Throwable> assumeThat(Throwable actual)
ThrowableAssert assumption.actual - the actual value.public static AbstractThrowableAssert<?,? extends Throwable> assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Throwable (easier done with lambdas).
Example :
@Test
public void testException() {
assumeThatThrownBy(() -> { throw new Exception("boom!") }).isInstanceOf(Exception.class)
.hasMessageContaining("boom");
}shouldRaiseThrowable - The ThrowableAssert.ThrowingCallable or lambda with the code that should raise the throwable.public static AbstractThrowableAssert<?,? extends Throwable> assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Throwable (easier done with lambdas).
The main difference with assumeThatThrownBy(ThrowingCallable) is that this method does not fail if no exception was thrown.
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 :(
shouldRaiseOrNotThrowable - The ThrowableAssert.ThrowingCallable or lambda with the code that should raise the throwable.ThrowableAssert.public static <T> ProxyablePredicateAssert<T> assumeThat(Predicate<T> actual)
PredicateAssert assumption.T - the Predicate type.actual - the Predicate to testpublic static IntPredicateAssert assumeThat(IntPredicate actual)
IntPredicateAssert assumption.actual - the IntPredicate to testpublic static LongPredicateAssert assumeThat(LongPredicate actual)
LongPredicateAssert assumption.actual - the LongPredicate to testpublic static DoublePredicateAssert assumeThat(DoublePredicate actual)
DoublePredicateAssert assumption.actual - the DoublePredicate to testpublic static <RESULT> CompletableFutureAssert<RESULT> assumeThat(CompletableFuture<RESULT> actual)
CompletableFutureAssert assumption.RESULT - the CompletableFuture wrapped type.actual - the CompletableFuture to testpublic static <RESULT> CompletableFutureAssert<RESULT> assumeThat(CompletionStage<RESULT> actual)
CompletableFutureAssert assumption for a CompletionStage
by converting it to a CompletableFuture and returning a CompletableFutureAssert.
If the given CompletionStage is null, the CompletableFuture in the returned CompletableFutureAssert will also be null.
RESULT - the CompletableFuture wrapped type.actual - the CompletableFuture to testpublic static <VALUE> OptionalAssert<VALUE> assumeThat(Optional<VALUE> actual)
OptionalAssert assumption.VALUE - the Optional wrapped type.actual - the Optional to testpublic static OptionalDoubleAssert assumeThat(OptionalDouble actual)
OptionalDoubleAssert assumption.actual - the OptionalDouble to testpublic static OptionalIntAssert assumeThat(OptionalInt actual)
OptionalIntAssert assumption.actual - the OptionalInt to testpublic static OptionalLongAssert assumeThat(OptionalLong actual)
OptionalLongAssert assumption.actual - the OptionalLong to testpublic static AbstractZonedDateTimeAssert<?> assumeThat(ZonedDateTime actual)
ZonedDateTimeAssert assumption.actual - the ZonedDateTime to testpublic static AbstractLocalDateTimeAssert<?> assumeThat(LocalDateTime actual)
LocalDateTimeAssert assumption.actual - the LocalDateTime to testpublic static AbstractOffsetDateTimeAssert<?> assumeThat(OffsetDateTime actual)
OffsetDateTimeAssert assumption.actual - the OffsetDateTime to testpublic static AbstractOffsetTimeAssert<?> assumeThat(OffsetTime actual)
OffsetTimeAssert assumption.actual - the LocalTime to testpublic static AbstractLocalTimeAssert<?> assumeThat(LocalTime actual)
LocalTimeAssert assumption.actual - the LocalTime to testpublic static AbstractLocalDateAssert<?> assumeThat(LocalDate actual)
LocalDateAssert assumption.actual - the LocalDate to testpublic static AbstractInstantAssert<?> assumeThat(Instant actual)
InstantAssert assumption.actual - the Instant to testpublic static <ELEMENT> AbstractListAssert<?,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>> assumeThat(Stream<? extends ELEMENT> actual)
ListAssert assumption from the given Stream.ELEMENT - the type of elements.actual - the Stream to testpublic static AbstractListAssert<?,List<? extends Double>,Double,ObjectAssert<Double>> assumeThat(DoubleStream actual)
ListAssert assumption from the given DoubleStream.actual - the DoubleStream to testpublic static AbstractListAssert<?,List<? extends Long>,Long,ObjectAssert<Long>> assumeThat(LongStream actual)
ListAssert assumption from the given LongStream.actual - the LongStream to testpublic static AbstractListAssert<?,List<? extends Integer>,Integer,ObjectAssert<Integer>> assumeThat(IntStream actual)
ListAssert assumption from the given IntStream.actual - the LongStream to testCopyright © 2014–2018 AssertJ. All rights reserved.