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 Detail

      • assumeThat

        default <T> ProxyableObjectArrayAssert<T> assumeThat​(T[] actual)
        Creates a new instance of ObjectArrayAssert assumption.
        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​(java.util.Map<K,​V> actual)
        Creates a new instance of MapAssert assumption.
        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 of ShortAssert assumption.
        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 of LongAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractLongAssert<?> assumeThat​(java.lang.Long actual)
        Creates a new instance of LongAssert assumption.
        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 of LongArrayAssert assumption.
        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 of ObjectAssert assumption.
        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​(java.lang.String actual)
        Creates a new instance of StringAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractDateAssert<?> assumeThat​(java.util.Date actual)
        Creates a new instance of DateAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractThrowableAssert<?,​? extends java.lang.Throwable> assumeThat​(java.lang.Throwable actual)
        Creates a new instance of ThrowableAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractBigDecimalAssert<?> assumeThat​(java.math.BigDecimal actual)
        Creates a new instance of BigDecimalAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractBigIntegerAssert<?> assumeThat​(java.math.BigInteger actual)
        Creates a new instance of BigIntegerAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AtomicBooleanAssert assumeThat​(java.util.concurrent.atomic.AtomicBoolean actual)
        Creates a new instance of AtomicBooleanAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AtomicIntegerAssert assumeThat​(java.util.concurrent.atomic.AtomicInteger actual)
        Creates a new instance of AtomicIntegerAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default AtomicIntegerArrayAssert assumeThat​(java.util.concurrent.atomic.AtomicIntegerArray actual)
        Creates int[] assumption for AtomicIntegerArray.
        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​(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<OBJECT> actual)
        Creates a new instance of AtomicIntegerFieldUpdaterAssert assumption.
        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​(java.util.concurrent.atomic.AtomicLong actual)
        Creates a new instance of AtomicLongAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default AtomicLongArrayAssert assumeThat​(java.util.concurrent.atomic.AtomicLongArray actual)
        Creates a new instance of AtomicLongArrayAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> assumeThat​(java.util.concurrent.atomic.AtomicLongFieldUpdater<OBJECT> actual)
        Creates a new instance of AtomicLongFieldUpdaterAssert assumption.
        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​(java.util.concurrent.atomic.AtomicReference<VALUE> actual)
        Creates a new instance of AtomicReferenceAssert assumption.
        Type Parameters:
        VALUE - the type of the value contained in the AtomicReference.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default <ELEMENT> AtomicReferenceArrayAssert<ELEMENT> assumeThat​(java.util.concurrent.atomic.AtomicReferenceArray<ELEMENT> actual)
        Creates a new instance of AtomicReferenceArrayAssert assumption.
        Type Parameters:
        ELEMENT - the type of the value contained in the AtomicReferenceArray.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default <FIELD,​OBJECT> AtomicReferenceFieldUpdaterAssert<FIELD,​OBJECT> assumeThat​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<OBJECT,​FIELD> actual)
        Creates a new instance of AtomicReferenceFieldUpdaterAssert assumption.
        Type Parameters:
        FIELD - the type of the field which gets updated by the AtomicReferenceFieldUpdater.
        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​(java.util.concurrent.atomic.AtomicMarkableReference<VALUE> actual)
        Creates a new instance of AtomicMarkableReferenceAssert assumption.
        Type Parameters:
        VALUE - the type of the value contained in the AtomicMarkableReference.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default <VALUE> AtomicStampedReferenceAssert<VALUE> assumeThat​(java.util.concurrent.atomic.AtomicStampedReference<VALUE> actual)
        Creates a new instance of AtomicStampedReferenceAssert assumption.
        Type Parameters:
        VALUE - the type of the value contained in the AtomicStampedReference.
        Parameters:
        actual - the actual value.
        Returns:
        the created assertion object.
      • assumeThat

        default AbstractCharSequenceAssert<?,​? extends java.lang.CharSequence> assumeThat​(java.lang.CharSequence actual)
        Creates a new instance of CharSequenceAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractCharSequenceAssert<?,​? extends java.lang.CharSequence> assumeThat​(java.lang.StringBuilder actual)
        Creates a new instance of CharSequenceAssert assumption from a StringBuilder.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        3.11.0
      • assumeThat

        default AbstractCharSequenceAssert<?,​? extends java.lang.CharSequence> assumeThat​(java.lang.StringBuffer actual)
        Creates a new instance of CharSequenceAssert assumption from a StringBuffer.
        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 of ShortArrayAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractShortAssert<?> assumeThat​(java.lang.Short actual)
        Creates a new instance of ShortAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractClassAssert<?> assumeThat​(java.lang.Class<?> actual)
        Creates a new instance of CharSequenceAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractCharacterAssert<?> assumeThat​(java.lang.Character actual)
        Creates a new instance of CharacterAssert assumption.
        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 of CharArrayAssert assumption.
        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 of CharacterAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default <T extends java.lang.Comparable<? super T>> AbstractComparableAssert<?,​T> assumeThat​(T actual)
        Creates a new instance of GenericComparableAssert assumption.
        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​(java.lang.Iterable<? extends ELEMENT> actual)
        Creates a new instance of IterableAssert assumption.
        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​(java.util.Iterator<? extends ELEMENT> actual)
        Creates a new instance of IteratorAssert assumption.

        Breaking change in version 3.12.0: this method does not return anymore an ProxyableIterableAssert but an IteratorAssert.

        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​(java.lang.Boolean actual)
        Creates a new instance of BooleanAssert assumption.
        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 of BooleanArrayAssert assumption.
        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 of ByteAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractByteAssert<?> assumeThat​(java.lang.Byte actual)
        Creates a new instance of ByteAssert assumption.
        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 of ByteArrayAssert assumption.
        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 of BooleanAssert assumption.
        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 of FloatAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractInputStreamAssert<?,​? extends java.io.InputStream> assumeThat​(java.io.InputStream actual)
        Creates a new instance of InputStreamAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractFileAssert<?> assumeThat​(java.io.File actual)
        Creates a new instance of FileAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default <RESULT> AbstractFutureAssert<?,​? extends java.util.concurrent.Future<? extends RESULT>,​RESULT> assumeThat​(java.util.concurrent.Future<RESULT> actual)
        Create assertion for FutureAssert assumption.
        Type Parameters:
        RESULT - the type of the value contained in the Future.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractPathAssert<?> assumeThat​(java.nio.file.Path actual)
        Creates a new instance of PathAssert assumption.
        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 of IntArrayAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractFloatAssert<?> assumeThat​(java.lang.Float actual)
        Creates a new instance of FloatAssert assumption.
        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 of IntegerAssert assumption.
        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 of FloatArrayAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractIntegerAssert<?> assumeThat​(java.lang.Integer actual)
        Creates a new instance of IntegerAssert assumption.
        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 of DoubleAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractDoubleAssert<?> assumeThat​(java.lang.Double actual)
        Creates a new instance of DoubleAssert assumption.
        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>,​java.util.List<? extends ELEMENT>,​ELEMENT,​ObjectAssert<ELEMENT>> assumeThat​(java.util.List<? extends ELEMENT> list)
        Creates a new instance of ListAssert assumption.
        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<?,​java.util.List<? extends ELEMENT>,​ELEMENT,​ObjectAssert<ELEMENT>> assumeThat​(java.util.stream.Stream<? extends ELEMENT> stream)
        Creates a new instance of ListAssert assumption from the given 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 AbstractListAssert<?,​java.util.List<? extends java.lang.Double>,​java.lang.Double,​ObjectAssert<java.lang.Double>> assumeThat​(java.util.stream.DoubleStream doubleStream)
        Creates a new instance of ListAssert assumption from the given DoubleStream.
        Parameters:
        doubleStream - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractListAssert<?,​java.util.List<? extends java.lang.Long>,​java.lang.Long,​ObjectAssert<java.lang.Long>> assumeThat​(java.util.stream.LongStream longStream)
        Creates a new instance of ListAssert assumption from the given LongStream.
        Parameters:
        longStream - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractListAssert<?,​java.util.List<? extends java.lang.Integer>,​java.lang.Integer,​ObjectAssert<java.lang.Integer>> assumeThat​(java.util.stream.IntStream intStream)
        Creates a new instance of ListAssert assumption from the given IntStream.
        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 of DoubleArrayAssert assumption.
        Parameters:
        actual - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractZonedDateTimeAssert<?> assumeThat​(java.time.ZonedDateTime zonedDateTime)
        Creates a new instance of ZonedDateTimeAssert assumption.
        Parameters:
        zonedDateTime - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        3.9.0
      • assumeThat

        default <RESULT> CompletableFutureAssert<RESULT> assumeThat​(java.util.concurrent.CompletableFuture<RESULT> future)
        Creates a new instance of CompletableFutureAssert 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​(java.util.concurrent.CompletionStage<RESULT> actual)
        Creates a new instance of 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.

        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​(java.util.Optional<VALUE> optional)
        Creates a new instance of OptionalAssert 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​(java.util.OptionalDouble optionalDouble)
        Creates a new instance of OptionalDoubleAssert assumption.
        Parameters:
        optionalDouble - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default OptionalIntAssert assumeThat​(java.util.OptionalInt optionalInt)
        Creates a new instance of OptionalIntAssert assumption.
        Parameters:
        optionalInt - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default OptionalLongAssert assumeThat​(java.util.OptionalLong optionalLong)
        Creates a new instance of OptionalLongAssert assumption.
        Parameters:
        optionalLong - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractLocalDateTimeAssert<?> assumeThat​(java.time.LocalDateTime localDateTime)
        Creates a new instance of LocalDateTimeAssert assumption.
        Parameters:
        localDateTime - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractLocalDateAssert<?> assumeThat​(java.time.LocalDate localDate)
        Creates a new instance of LocalDateAssert assumption.
        Parameters:
        localDate - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractLocalTimeAssert<?> assumeThat​(java.time.LocalTime localTime)
        Creates a new instance of LocalTimeAssert assumption.
        Parameters:
        localTime - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractInstantAssert<?> assumeThat​(java.time.Instant instant)
        Creates a new instance of InstantAssert assumption.
        Parameters:
        instant - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractOffsetTimeAssert<?> assumeThat​(java.time.OffsetTime offsetTime)
        Creates a new instance of OffsetTimeAssert assumption.
        Parameters:
        offsetTime - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractOffsetDateTimeAssert<?> assumeThat​(java.time.OffsetDateTime offsetDateTime)
        Creates a new instance of OffsetDateTimeAssert assumption.
        Parameters:
        offsetDateTime - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThatThrownBy

        default AbstractThrowableAssert<?,​? extends java.lang.Throwable> assumeThatThrownBy​(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
        Allows to capture and then assume on a Throwable (easier done with lambdas).

        Example :

          @Test
          public void testException() {
            assumeThatThrownBy(() -> { throw new Exception("boom!") }).isInstanceOf(Exception.class)
                                                                      .hasMessageContaining("boom");
         }
        Parameters:
        shouldRaiseThrowable - The ThrowableAssert.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 AbstractThrowableAssert<?,​? extends java.lang.Throwable> assumeThatCode​(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
        Allows to capture and then assume on a Throwable (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 - The ThrowableAssert.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> ProxyableObjectAssert<T> assumeThatObject​(T actual)
        Creates a new instance of ObjectAssert for any object.

        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:

        assumeThat(new LinkedList<>(asList("abc"))).matches(list -> ((Deque<String>) list).getFirst().equals("abc")); 
        No cast needed, but also no additional list assertions:
        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​(java.util.function.Predicate<T> predicate)
        Creates a new instance of PredicateAssert assumption.
        Type Parameters:
        T - the Predicate type.
        Parameters:
        predicate - the Predicate to test
        Returns:
        the created assumption for assertion object.
        Since:
        3.9.0
      • assumeThat

        default IntPredicateAssert assumeThat​(java.util.function.IntPredicate intPredicate)
        Creates a new instance of IntPredicateAssert assumption.
        Parameters:
        intPredicate - the IntPredicate to test
        Returns:
        the created assumption for assertion object.
        Since:
        3.9.0
      • assumeThat

        default LongPredicateAssert assumeThat​(java.util.function.LongPredicate longPredicate)
        Creates a new instance of LongPredicateAssert assumption.
        Parameters:
        longPredicate - the LongPredicate to test
        Returns:
        the created assumption for assertion object.
        Since:
        3.9.0
      • assumeThat

        default DoublePredicateAssert assumeThat​(java.util.function.DoublePredicate doublePredicate)
        Creates a new instance of DoublePredicateAssert assumption.
        Parameters:
        doublePredicate - the DoublePredicate to test
        Returns:
        the created assumption for assertion object.
        Since:
        3.9.0
      • assumeThat

        default AbstractUrlAssert<?> assumeThat​(java.net.URL url)
        Creates a new instance of UrlAssert assumption.
        Parameters:
        url - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0
      • assumeThat

        default AbstractUriAssert<?> assumeThat​(java.net.URI uri)
        Creates a new instance of UriAssert assumption.
        Parameters:
        uri - the actual value.
        Returns:
        the created assumption for assertion object.
        Since:
        2.9.0 / 3.9.0