The difference with the Assumptions class is that entry point methods are named given instead of
assumeThat.
BDDAssumptions and BDDAssertions complement each other to allow a fluent Behavior-driven development.
Examples:
String hobbit = "HOBBIT";
List<String> fellowshipOfTheRing = list("Aragorn", "Gandalf", "Frodo", "Legolas"); // and more
@Test
public void given_the_assumption_is_not_met_the_test_is_skipped() {
given(hobbit).isEqualTo("ORC");
// ... following code is not executed
then(fellowshipOfTheRing).contains("Sauron");
}
@Test
public void given_the_assumption_is_met_the_test_is_executed() {
given(hobbit).isEqualTo("HOBBIT");
// ... following code is executed
then(fellowshipOfTheRing).doesNotContain("Sauron");
}
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractBooleanAssert | Returns: theAbstractBooleanAssert assertion object to be used for assumptions.the actual actual)boolean value to be validated.Creates a new assumption's instance for a |
| public static AbstractBooleanAssert | Returns: theAbstractBooleanAssert assertion object to be used for assumptions.the actual actual)Boolean value to be validated.Creates a new assumption's instance for a |
| public static AbstractBooleanArrayAssert | Returns: theAbstractBooleanArrayAssert assertion object to be used for assumptions.the actual actual)booleans' array to be validated.Creates a new assumption's instance for a |
| public static Boolean2DArrayAssert | Returns: theBoolean2DArrayAssert assertion object to be used for assumptions.the actual actual)booleans' two-dimensional array to be validated.Creates a new assumption's instance for a |
| public static AbstractByteAssert | Returns: theAbstractByteAssert assertion object to be used for assumptions.the actual actual)byte value to be validated.Creates a new assumption's instance for a |
| public static AbstractByteAssert | Returns: theAbstractByteAssert assertion object to be used for assumptions.the actual actual)Byte value to be validated.Creates a new assumption's instance for a |
| public static AbstractByteArrayAssert | Returns: theAbstractByteArrayAssert assertion object to be used for assumptions.the actual bytes' array to be validated. actual)Creates a new assumption's instance for a |
| public static Byte2DArrayAssert | Returns: theByte2DArrayAssert assertion object to be used for assumptions.the actual bytes' two-dimensional array to be validated. actual)Creates a new assumption's instance for a |
| public static AbstractShortAssert | Returns: theAbstractShortAssert assertion object to be used for assumptions.the actual actual)short value to be validated.Creates a new assumption's instance for a |
| public static AbstractShortAssert | Returns: theAbstractShortAssert assertion object to be used for assumptions.the actual actual)Short value to be validated.Creates a new assumption's instance for a |
| public static AbstractShortArrayAssert | Returns: theAbstractShortArrayAssert assertion object to be used for assumptions.the actual actual)shorts' array to be validated.Creates a new assumption's instance for a |
| public static Short2DArrayAssert | Returns: theShort2DArrayAssert assertion object to be used for assumptions.the actual actual)shorts' two-dimensional array to be validated.Creates a new assumption's instance for a |
| public static AbstractIntegerAssert | Returns: theAbstractIntegerAssert assertion object to be used for assumptions.the actual actual)int value to be validated.Creates a new assumption's instance for an |
| public static AbstractIntegerAssert | Returns: theAbstractIntegerAssert assertion object to be used for assumptions.the actual actual)Integer value to be validated.Creates a new assumption's instance for an |
| public static AbstractIntArrayAssert | Returns: theAbstractIntArrayAssert assertion object to be used for assumptions.the actual actual)ints' array to be validated.Creates a new assumption's instance for an |
| public static Int2DArrayAssert | Returns: theInt2DArrayAssert assertion object to be used for assumptions.the actual actual)ints' two-dimensional array to be validated.Creates a new assumption's instance for an |
| public static AbstractBigIntegerAssert | Returns: theAbstractBigIntegerAssert assertion object to be used for assumptions.the actual actual)BigInteger value to be validated.Creates a new assumption's instance for a |
| public static AbstractLongAssert | Returns: theAbstractLongAssert assertion object to be used for assumptions.the actual actual)long value to be validated.Creates a new assumption's instance for a |
| public static AbstractLongAssert | Returns: theAbstractLongAssert assertion object to be used for assumptions.the actual actual)Long value to be validated.Creates a new assumption's instance for a |
| public static AbstractLongArrayAssert | Returns: theAbstractLongArrayAssert assertion object to be used for assumptions.the actual actual)longs' array to be validated.Creates a new assumption's instance for a |
| public static Long2DArrayAssert | Returns: theLong2DArrayAssert assertion object to be used for assumptions.the actual actual)longs' two-dimensional array to be validated.Creates a new assumption's instance for a |
| public static AbstractFloatAssert | Returns: theAbstractFloatAssert assertion object to be used for assumptions.the actual actual)float value to be validated.Creates a new assumption's instance for a |
| public static AbstractFloatAssert | Returns: theAbstractFloatAssert assertion object to be used for assumptions.the actual actual)Float value to be validated.Creates a new assumption's instance for a |
| public static AbstractFloatArrayAssert | Returns: theAbstractFloatArrayAssert assertion object to be used for assumptions.the actual actual)floats' array to be validated.Creates a new assumption's instance for a |
| public static Float2DArrayAssert | Returns: theFloat2DArrayAssert assertion object to be used for assumptions.the actual actual)floats' two-dimensional array to be validated.Creates a new assumption's instance for a |
| public static AbstractDoubleAssert | Returns: theAbstractDoubleAssert assertion object to be used for assumptions.the actual actual)double value to be validated.Creates a new assumption's instance for a |
| public static AbstractDoubleAssert | Returns: theAbstractDoubleAssert assertion object to be used for assumptions.the actual actual)Double value to be validated.Creates a new assumption's instance for a |
| public static AbstractDoubleArrayAssert | Returns: theAbstractDoubleArrayAssert assertion object to be used for assumptions.the actual actual)doubles' array to be validated.Creates a new assumption's instance for an |
| public static Double2DArrayAssert | Returns: theDouble2DArrayAssert assertion object to be used for assumptions.the actual actual)doubles' two-dimensional array to be validated.Creates a new assumption's instance for an |
| public static AbstractBigDecimalAssert | Returns: theAbstractBigDecimalAssert assertion object to be used for assumptions.the actual actual)BigDecimal value to be validated.Creates a new assumption's instance for a |
| public static AbstractCharacterAssert | Returns: theAbstractCharacterAssert assertion object to be used for assumptions.the actual actual)char value to be validated.Creates a new assumption's instance for a |
| public static AbstractCharacterAssert | Returns: theAbstractCharacterAssert assertion object to be used for assumptions.the actual actual)Character value to be validated.Creates a new assumption's instance for a |
| public static AbstractCharArrayAssert | Returns: theAbstractCharacterAssert assertion object to be used for assumptions.the actual actual)chars' array to be validated.Creates a new assumption's instance for an |
| public static Char2DArrayAssert | Returns: theChar2DArrayAssert assertion object to be used for assumptions.the actual actual)chars' two-dimensional array to be validated.Creates a new assumption's instance for an |
| public static AbstractCharSequenceAssert | Returns: theAbstractCharSequenceAssert assertion object to be used for assumptions.the actual actual)CharSequence value to be validated.Creates a new assumption's instance for a |
| public static AbstractStringAssert | Returns: theAbstractStringAssert assertion object to be used for assumptions.the actual actual)String value to be validated.Creates a new assumption's instance for a |
| public static AbstractCharSequenceAssert | Returns: theAbstractCharSequenceAssert assertion object to be used for assumptions.the actual actual)StringBuilder value to be validated.Creates a new assumption's instance for a |
| public static AbstractCharSequenceAssert | Returns: theAbstractCharSequenceAssert assertion object to be used for assumptions.the actual actual)StringBuffer value to be validated.Creates a new assumption's instance for a |
| public static ClassAssert | Returns: theAbstractClassAssert assertion object to be used for assumptions.the actual actual)Class value to be validated.Creates a new assumption's instance for a |
| public static < the type of the actual object. T> ObjectAssert | Returns: theAbstractObjectAssert assertion object to be used for assumptions.the actual object to be validated. actual)Creates a new assumption's instance for an object value. |
| public static < the type of elements of the actual objects' array. T> ObjectArrayAssert | Returns: theAbstractObjectArrayAssert assertion object to be used for assumptions.the actual objects' array to be validated.. actual)Creates a new assumption's instance for an objects' array. |
| public static < the type of elements of the actual objects' two-dimensional array. T> Object2DArrayAssert | Returns: theObject2DArrayAssert assertion object to be used for assumptions.the actual objects' two-dimensional array to be validated.. actual)Creates a new assumption's instance for an objects' two-dimensional array. |
| public static < the type of the actual comparable value. T extends Comparable | Returns: theAbstractComparableAssert assertion object to be used for assumptions.the actual actual)Comparable value to be validated.Creates a new assumption's instance for a |
| public static < the type of the actual throwable. T extends Throwable> AbstractThrowableAssert | Returns: theAbstractThrowableAssert assertion object to be used for assumptions.the actual actual)Throwable value to be validated.Creates a new assumption's instance for a |
| public static < the type of elements of actual iterable value. ELEMENT> IterableAssert | Returns: theAbstractIterableAssert assertion object to be used for assumptions.the actual actual)Iterable value to be validated.Creates a new assumption's instance for an |
| public static < the type of elements of actual iterator value. ELEMENT> IteratorAssert | Returns: theAbstractIteratorAssert assertion object to be used for assumptions.the actual actual)Iterator value to be validated.Creates a new assumption's instance for an |
| public static < the type of elements. E> AbstractCollectionAssert | Returns: the created assumption for assertion object.the actual value. actual)Creates a new assumption's instance for a |
| public static < the type of elements of actual list value. ELEMENT> FactoryBasedNavigableListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)List value to be validated.Creates a new assumption's instance for a |
| public static < the type of keys in the actual map value. K, the type of values in the actual map value. V> MapAssert | Returns: theAbstractMapAssert assertion object to be used for assumptions.the actual actual)Map value to be validated.Creates a new assumption's instance for a |
| public static < the type of the value contained in the actual predicate value. T> PredicateAssert | Returns: theAbstractPredicateAssert assertion object to be used for assumptions.the actual actual)Predicate value to be validated.Creates a new assumption's instance for a |
| public static IntPredicateAssert | Returns: theIntPredicateAssert assertion object to be used for assumptions.the actual actual)IntPredicate value to be validated.Creates a new assumption's instance for an |
| public static LongPredicateAssert | Returns: theLongPredicateAssert assertion object to be used for assumptions.the actual actual)LongPredicate value to be validated.Creates a new assumption's instance for a |
| public static DoublePredicateAssert | Returns: theDoublePredicateAssert assertion object to be used for assumptions.the actual actual)DoublePredicate value to be validated.Creates a new assumption's instance for a |
| public static < the type of the value contained in the actual optional value. VALUE> OptionalAssert | Returns: theOptionalAssert assertion object to be used for assumptions.the actual actual)Optional value to be validated.Creates a new assumption's instance for an |
| public static OptionalIntAssert | Returns: theOptionalIntAssert assertion object to be used for assumptions.the actual actual)OptionalInt value to be validated.Creates a new assumption's instance for an |
| public static MatcherAssert | |
| public static OptionalLongAssert | Returns: theOptionalLongAssert assertion object to be used for assumptions.the actual actual)OptionalLong value to be validated.Creates a new assumption's instance for an |
| public static OptionalDoubleAssert | Returns: theOptionalDoubleAssert assertion object to be used for assumptions.the actual actual)OptionalDouble value to be validated.Creates a new assumption's instance for an |
| public static < the type of the value contained in the actual stream value. ELEMENT> AbstractListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)Stream value to be validated.Creates a new assumption's instance for a |
| public static AbstractListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)IntStream value to be validated.Creates a new assumption's instance for an |
| public static < the type of the elements ELEMENT> AbstractSpliteratorAssert | Returns: theAbstractSpliteratorAssert assertion object to be used for assumptions.the actual actual)Spliterator value to be validated.Creates a new assumption's instance for a |
| public static AbstractListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)LongStream value to be validated.Creates a new assumption's instance for a |
| public static AbstractListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)DoubleStream value to be validated.Creates a new assumption's instance for a |
| public static < the type of the value contained in the actual future value. RESULT> AbstractFutureAssert | Returns: theAbstractFutureAssert assertion object to be used for assumptions.the future)Future value to be validated.Creates a new assumption's instance for a |
| public static < the type of the value contained in the actual future value. RESULT> CompletableFutureAssert | Returns: theAbstractCompletableFutureAssert assertion object to be used for assumptions.the future)CompletableFuture value to be validated.Creates a new assumption's instance for a |
| public static < the type of the value contained in the actual future value. RESULT> CompletableFutureAssert | Returns: theAbstractCompletableFutureAssert assertion object to be used for assumptions.the stage)CompletionStage value to be validated.Creates a new assumption's instance for a |
| public static AtomicBooleanAssert | Returns: theAtomicBooleanAssert assertion object to be used for assumptions.the actual actual)AtomicBoolean value to be validated.Creates a new assumption's instance for an |
| public static AtomicIntegerAssert | Returns: theAtomicIntegerAssert assertion object to be used for assumptions.the actual actual)AtomicInteger value to be validated.Creates a new assumption's instance for an |
| public static AtomicIntegerArrayAssert | Returns: theAtomicIntegerArrayAssert assertion object to be used for assumptions.the actual actual)AtomicIntegerArray value to be validated.Creates a new assumption's instance for an |
| public static < the type of the object holding the updatable field which gets updated by the actual value. OBJECT> AtomicIntegerFieldUpdaterAssert | Returns: theAtomicIntegerFieldUpdaterAssert assertion object to be used for assumptions.the actual actual)AtomicIntegerFieldUpdater value to be validated.Creates a new assumption's instance for an |
| public static LongAdderAssert | Returns: theLongAdderAssert assertion object to be used for assumptions.the actual actual)LongAdder value to be validated.Creates a new assumption's instance for a |
| public static AtomicLongAssert | Returns: theAtomicLongAssert assertion object to be used for assumptions.the actual actual)AtomicLong value to be validated.Creates a new assumption's instance for an |
| public static AtomicLongArrayAssert | Returns: theAtomicLongArrayAssert assertion object to be used for assumptions.the actual actual)AtomicLongArray value to be validated.Creates a new assumption's instance for an |
| public static < the type of the object holding the updatable field which gets updated by the actual value. OBJECT> AtomicLongFieldUpdaterAssert | Returns: theAtomicLongFieldUpdaterAssert assertion object to be used for assumptions.the actual actual)AtomicLongFieldUpdater value to be validated.Creates a new assumption's instance for an |
| public static < the type of the value contained by the actual reference. VALUE> AtomicReferenceAssert | Returns: theAtomicReferenceAssert assertion object to be used for assumptions.the actual actual)AtomicReference to be validated.Creates a new assumption's instance for an |
| public static < the type of the value contained in the actual references' array. ELEMENT> AtomicReferenceArrayAssert | Returns: theAtomicReferenceArrayAssert assertion object to be used for assumptions.the actual actual)AtomicReferenceArray to be validated.Creates a new assumption's instance for an |
| public static < the type of the field which gets updated by the actual updater. FIELD, the type of the object holding the updatable field which gets updated by the actual updater. OBJECT> AtomicReferenceFieldUpdaterAssert | Returns: theAtomicReferenceFieldUpdaterAssert assertion object to be used for assumptions.the actual actual)AtomicReferenceFieldUpdater value to be validated.Creates a new assumption's instance for an |
| public static < the type of the value contained by the actual reference. VALUE> AtomicMarkableReferenceAssert | Returns: theAtomicMarkableReferenceAssert assertion object to be used for assumptions.the actual actual)AtomicMarkableReference to be validated.Creates a new assumption's instance for an |
| public static < the type of the value contained by the actual reference. VALUE> AtomicStampedReferenceAssert | Returns: theAtomicStampedReferenceAssert assertion object to be used for assumptions.the actual actual)AtomicStampedReference to be validated.Creates a new assumption's instance for an |
| public static AbstractDateAssert | Returns: theAbstractDateAssert assertion object to be used for assumptions.the actual actual)Date value to be validated.Creates a new assumption's instance for a |
| public static AbstractLocalDateAssert | Returns: theAbstractLocalDateAssert assertion object to be used for assumptions.the actual actual)LocalDate value to be validated.Creates a new assumption's instance for a |
| public static AbstractLocalTimeAssert | Returns: theAbstractLocalTimeAssert assertion object to be used for assumptions.the actual actual)LocalTime value to be validated.Creates a new assumption's instance for a |
| public static AbstractOffsetTimeAssert | Returns: theAbstractOffsetTimeAssert assertion object to be used for assumptions.the actual actual)OffsetTime value to be validated.Creates a new assumption's instance for an |
| public static AbstractLocalDateTimeAssert | Returns: theAbstractLocalDateTimeAssert assertion object to be used for assumptions.the actual actual)LocalDateTime value to be validated.Creates a new assumption's instance for a |
| public static AbstractInstantAssert | Returns: theAbstractInstantAssert assertion object to be used for assumptions.the actual actual)Instant value to be validated.Creates a new assumption's instance for an |
| public static AbstractDurationAssert | |
| public static AbstractPeriodAssert | Returns: the created assertion object.the actual value. actual)Creates a new assumption's instance for a |
| public static AbstractOffsetDateTimeAssert | Returns: theAbstractOffsetDateTimeAssert assertion object to be used for assumptions.the actual actual)OffsetDateTime value to be validated.Creates a new assumption's instance for an |
| public static AbstractZonedDateTimeAssert | Returns: theAbstractZonedDateTimeAssert assertion object to be used for assumptions.the actual actual)ZonedDateTime value to be validated.Creates a new assumption's instance for a |
| public static AbstractInputStreamAssert | Returns: theAbstractInputStreamAssert assertion object to be used for assumptions.the actual actual)InputStream value to be validated.Creates a new assumption's instance for an |
| public static AbstractFileAssert | Returns: theAbstractFileAssert assertion object to be used for assumptions.the actual actual)File value to be validated.Creates a new assumption's instance for a |
| public static AbstractPathAssert | Returns: theAbstractPathAssert assertion object to be used for assumptions.the actual actual)Path value to be validated.Creates a new assumption's instance for a |
| public static AbstractUriAssert | Returns: theAbstractUriAssert assertion object to be used for assumptions.the actual actual)URI value to be validated.Creates a new assumption's instance for an |
| public static AbstractUrlAssert | Returns: theAbstractUrlAssert assertion object to be used for assumptions.the actual actual)URL value to be validated.Creates a new assumption's instance for an |
| public static AbstractCharSequenceAssert | Returns: theAbstractCharSequenceAssert assertion object to be used for assumptions.the actual actual)CharSequence value to be validated.Creates a new assumption's instance for a |
| public static AbstractThrowableAssert | Returns: theAbstractThrowableAssert assertion object to be used for assumptions.the lambdaThrowingCallable or lambda with the code that may raise a throwable to be validated.Creates a new assumption's instance from a no parameters lambda expression, |
| public static < the type of elements. E> AbstractCollectionAssert | Returns: the created assumption for assertion object.the actual value. actual)Creates a new assumption's instance of a |
| public static < the type of elements. T extends Comparable | Returns: the created assumption for assertion object.the actual value. actual)Creates a new assumption's instance of a |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static < the exception type. T extends Throwable> ThrowableTypeAssert | Returns: the createdThrowableTypeAssert.the exception type class. exceptionType)Creates a new assumption's instance for a |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static < the type of elements of actual iterable value. ELEMENT> IterableAssert | Returns: theAbstractIterableAssert assertion object to be used for assumptions.the actual actual)Iterable value to be validated.Creates a new assumption's instance of an |
| public static < the type of elements of actual iterable value. ELEMENT> IteratorAssert | Returns: theAbstractIteratorAssert assertion object to be used for assumptions.the actual actual)Iterator value to be validated.Creates a new assumption's instance of an |
| public static < the type of elements. ELEMENT> FactoryBasedNavigableListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual value. actual)Creates a new assumption's instance of a |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static < the type of the actual object. T> ObjectAssert | Returns: theAbstractObjectAssert assertion object to be used for assumptions.the actual object to be validated. actual)Creates a new assumption's instance for an object value. |
| public static AbstractPathAssert | Returns: theAbstractPathAssert assertion object to be used for assumptions.the actual actual)Path value to be validated.Creates a new assumption's instance of a |
| public static < the type of elements. T> PredicateAssert | Returns: theAbstractPredicateAssert assertion object to be used for assumptions.the actual value. actual)Creates a new assumption's instance of a |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static ThrowableTypeAssert | Returns: theThrowableAssert assertion object to be used for assumptions.Alias for |
| public static < the type of elements. ELEMENT> AbstractListAssert | Returns: theAbstractListAssert assertion object to be used for assumptions.the actual actual)Stream value to be validated.Creates a new assumption's instance of a |
| public static void | setPreferredAssumptionException(PreferredAssumptionException
the preferred exception to use with preferredAssumptionException)BDDAssumptions.Hides org. |