public abstract class AbstractBDDSoftAssertions extends AbstractSoftAssertions
proxies
Constructor and Description |
---|
AbstractBDDSoftAssertions() |
Modifier and Type | Method and Description |
---|---|
BigDecimalAssert |
then(java.math.BigDecimal actual)
Creates a new instance of
. |
BooleanAssert |
then(boolean actual)
Creates a new instance of
. |
BooleanAssert |
then(java.lang.Boolean actual)
Creates a new instance of
. |
BooleanArrayAssert |
then(boolean[] actual)
Creates a new instance of
. |
ByteAssert |
then(byte actual)
Creates a new instance of
. |
ByteAssert |
then(java.lang.Byte actual)
Creates a new instance of
. |
ByteArrayAssert |
then(byte[] actual)
Creates a new instance of
. |
CharacterAssert |
then(char actual)
Creates a new instance of
. |
CharArrayAssert |
then(char[] actual)
Creates a new instance of
. |
CharacterAssert |
then(java.lang.Character actual)
Creates a new instance of
. |
CharSequenceAssert |
then(java.lang.CharSequence actual)
Creates a new instance of
. |
SoftAssertionClassAssert |
then(java.lang.Class<?> actual)
Creates a new instance of
|
DateAssert |
then(java.util.Date actual)
Creates a new instance of
. |
DoubleAssert |
then(double actual)
Creates a new instance of
. |
DoubleAssert |
then(java.lang.Double actual)
Creates a new instance of
. |
DoubleArrayAssert |
then(double[] actual)
Creates a new instance of
. |
FileAssert |
then(java.io.File actual)
Creates a new instance of
. |
FloatAssert |
then(float actual)
Creates a new instance of
. |
FloatAssert |
then(java.lang.Float actual)
Creates a new instance of
. |
FloatArrayAssert |
then(float[] actual)
Creates a new instance of
. |
InputStreamAssert |
then(java.io.InputStream actual)
Creates a new instance of
. |
IntegerAssert |
then(int actual)
Creates a new instance of
. |
IntArrayAssert |
then(int[] actual)
Creates a new instance of
. |
IntegerAssert |
then(java.lang.Integer actual)
Creates a new instance of
. |
<T> IterableAssert<T> |
then(java.lang.Iterable<? extends T> actual)
Creates a new instance of
. |
<T> IterableAssert<T> |
then(java.util.Iterator<T> actual)
Creates a new instance of
. |
<T> ListAssert<T> |
then(java.util.List<? extends T> actual)
Creates a new instance of
. |
LongAssert |
then(long actual)
Creates a new instance of
. |
LongAssert |
then(java.lang.Long actual)
Creates a new instance of
. |
LongArrayAssert |
then(long[] actual)
Creates a new instance of
. |
<K,V> SoftAssertionMapAssert<K,V> |
then(java.util.Map<K,V> actual)
Creates a new instance of
. |
PathAssert |
then(java.nio.file.Path actual)
Creates a new, proxied instance of a
PathAssert |
ShortAssert |
then(short actual)
Creates a new instance of
. |
ShortAssert |
then(java.lang.Short actual)
Creates a new instance of
. |
ShortArrayAssert |
then(short[] actual)
Creates a new instance of
. |
StringAssert |
then(java.lang.String actual)
Creates a new instance of
. |
<T> ObjectAssert<T> |
then(T actual)
Creates a new instance of
. |
<T> ObjectArrayAssert<T> |
then(T[] actual)
Creates a new instance of
. |
ThrowableAssert |
then(java.lang.Throwable actual)
Creates a new instance of
. |
UriAssert |
then(java.net.URI actual)
Creates a new instance of
. |
AbstractThrowableAssert<?,? extends java.lang.Throwable> |
thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
proxy
public BigDecimalAssert then(java.math.BigDecimal actual)
BigDecimalAssert
.actual
- the actual value.public BooleanAssert then(boolean actual)
BooleanAssert
.actual
- the actual value.public BooleanAssert then(java.lang.Boolean actual)
BooleanAssert
.actual
- the actual value.public BooleanArrayAssert then(boolean[] actual)
BooleanArrayAssert
.actual
- the actual value.public ByteAssert then(byte actual)
ByteAssert
.actual
- the actual value.public ByteAssert then(java.lang.Byte actual)
ByteAssert
.actual
- the actual value.public ByteArrayAssert then(byte[] actual)
ByteArrayAssert
.actual
- the actual value.public CharacterAssert then(char actual)
CharacterAssert
.actual
- the actual value.public CharArrayAssert then(char[] actual)
CharArrayAssert
.actual
- the actual value.public CharacterAssert then(java.lang.Character actual)
CharacterAssert
.actual
- the actual value.public SoftAssertionClassAssert then(java.lang.Class<?> actual)
ClassAssert
We don't return ClassAssert
as it has overridden methods to annotated with SafeVarargs
.actual
- the actual value.public <T> IterableAssert<T> then(java.lang.Iterable<? extends T> actual)
IterableAssert
.actual
- the actual value.public <T> IterableAssert<T> then(java.util.Iterator<T> actual)
actual
- the actual value.public DoubleAssert then(double actual)
DoubleAssert
.actual
- the actual value.public DoubleAssert then(java.lang.Double actual)
DoubleAssert
.actual
- the actual value.public DoubleArrayAssert then(double[] actual)
DoubleArrayAssert
.actual
- the actual value.public FileAssert then(java.io.File actual)
FileAssert
.actual
- the actual value.public PathAssert then(java.nio.file.Path actual)
PathAssert
actual
- the pathpublic InputStreamAssert then(java.io.InputStream actual)
InputStreamAssert
.actual
- the actual value.public FloatAssert then(float actual)
FloatAssert
.actual
- the actual value.public FloatAssert then(java.lang.Float actual)
FloatAssert
.actual
- the actual value.public FloatArrayAssert then(float[] actual)
FloatArrayAssert
.actual
- the actual value.public IntegerAssert then(int actual)
IntegerAssert
.actual
- the actual value.public IntArrayAssert then(int[] actual)
IntArrayAssert
.actual
- the actual value.public IntegerAssert then(java.lang.Integer actual)
IntegerAssert
.actual
- the actual value.public <T> ListAssert<T> then(java.util.List<? extends T> actual)
ListAssert
.actual
- the actual value.public LongAssert then(long actual)
LongAssert
.actual
- the actual value.public LongAssert then(java.lang.Long actual)
LongAssert
.actual
- the actual value.public LongArrayAssert then(long[] actual)
LongArrayAssert
.actual
- the actual value.public <T> ObjectAssert<T> then(T actual)
ObjectAssert
.actual
- the actual value.public <T> ObjectArrayAssert<T> then(T[] actual)
ObjectArrayAssert
.actual
- the actual value.public <K,V> SoftAssertionMapAssert<K,V> then(java.util.Map<K,V> actual)
MapAssert
.
We don't return MapAssert
as it has overridden methods to annotated with SafeVarargs
.actual
- the actual value.public ShortAssert then(short actual)
ShortAssert
.actual
- the actual value.public ShortAssert then(java.lang.Short actual)
ShortAssert
.actual
- the actual value.public ShortArrayAssert then(short[] actual)
ShortArrayAssert
.actual
- the actual value.public CharSequenceAssert then(java.lang.CharSequence actual)
CharSequenceAssert
.actual
- the actual value.public StringAssert then(java.lang.String actual)
StringAssert
.actual
- the actual value.public DateAssert then(java.util.Date actual)
DateAssert
.actual
- the actual value.public ThrowableAssert then(java.lang.Throwable actual)
ThrowableAssert
.actual
- the actual value.public AbstractThrowableAssert<?,? extends java.lang.Throwable> thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Throwable
more easily when used with Java 8 lambdas.
Java 8 example :
@Test
public void testException() {
BDDSoftAssertions softly = new BDDSoftAssertions();
softly.thenThrownBy(() -> { throw new Exception("boom!") }).isInstanceOf(Exception.class)
.hasMessageContaining("boom");
}
Java 7 example :
BDDSoftAssertions softly = new BDDSoftAssertions();
softly.thenThrownBy(new ThrowingCallable() {
@Override
public Void call() throws Exception {
throw new Exception("boom!");
}
}).isInstanceOf(Exception.class)
.hasMessageContaining("boom");
shouldRaiseThrowable
- The ThrowableAssert.ThrowingCallable
or lambda with the code that should raise the throwable.null
if none was raised by the callable.