public abstract class AbstractStandardSoftAssertions extends AbstractSoftAssertions
proxies
Constructor and Description |
---|
AbstractStandardSoftAssertions() |
Modifier and Type | Method and Description |
---|---|
BigDecimalAssert |
assertThat(BigDecimal actual)
Creates a new instance of
. |
BooleanAssert |
assertThat(boolean actual)
Creates a new instance of
. |
BooleanAssert |
assertThat(Boolean actual)
Creates a new instance of
. |
BooleanArrayAssert |
assertThat(boolean[] actual)
Creates a new instance of
. |
ByteAssert |
assertThat(byte actual)
Creates a new instance of
. |
ByteAssert |
assertThat(Byte actual)
Creates a new instance of
. |
ByteArrayAssert |
assertThat(byte[] actual)
Creates a new instance of
. |
CharacterAssert |
assertThat(char actual)
Creates a new instance of
. |
CharArrayAssert |
assertThat(char[] actual)
Creates a new instance of
. |
CharacterAssert |
assertThat(Character actual)
Creates a new instance of
. |
CharSequenceAssert |
assertThat(CharSequence actual)
Creates a new instance of
. |
SoftAssertionClassAssert |
assertThat(Class<?> actual)
Creates a new instance of
|
DateAssert |
assertThat(Date actual)
Creates a new instance of
. |
DoubleAssert |
assertThat(double actual)
Creates a new instance of
. |
DoubleAssert |
assertThat(Double actual)
Creates a new instance of
. |
DoubleArrayAssert |
assertThat(double[] actual)
Creates a new instance of
. |
FileAssert |
assertThat(File actual)
Creates a new instance of
. |
FloatAssert |
assertThat(float actual)
Creates a new instance of
. |
FloatAssert |
assertThat(Float actual)
Creates a new instance of
. |
FloatArrayAssert |
assertThat(float[] actual)
Creates a new instance of
. |
InputStreamAssert |
assertThat(InputStream actual)
Creates a new instance of
. |
IntegerAssert |
assertThat(int actual)
Creates a new instance of
. |
IntArrayAssert |
assertThat(int[] actual)
Creates a new instance of
. |
IntegerAssert |
assertThat(Integer actual)
Creates a new instance of
. |
<T> IterableAssert<T> |
assertThat(Iterable<? extends T> actual)
Creates a new instance of
. |
<T> IterableAssert<T> |
assertThat(Iterator<T> actual)
Creates a new instance of
. |
<T> ListAssert<T> |
assertThat(List<? extends T> actual)
Creates a new instance of
. |
LongAssert |
assertThat(long actual)
Creates a new instance of
. |
LongAssert |
assertThat(Long actual)
Creates a new instance of
. |
LongArrayAssert |
assertThat(long[] actual)
Creates a new instance of
. |
<K,V> SoftAssertionMapAssert<K,V> |
assertThat(Map<K,V> actual)
Creates a new instance of
. |
PathAssert |
assertThat(java.nio.file.Path actual)
Creates a new, proxied instance of a
PathAssert |
ShortAssert |
assertThat(short actual)
Creates a new instance of
. |
ShortAssert |
assertThat(Short actual)
Creates a new instance of
. |
ShortArrayAssert |
assertThat(short[] actual)
Creates a new instance of
. |
StringAssert |
assertThat(String actual)
Creates a new instance of
. |
<T> ObjectAssert<T> |
assertThat(T actual)
Creates a new instance of
. |
<T> ObjectArrayAssert<T> |
assertThat(T[] actual)
Creates a new instance of
. |
ThrowableAssert |
assertThat(Throwable actual)
Creates a new instance of
. |
AbstractThrowableAssert<?,? extends Throwable> |
assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
proxy
public BigDecimalAssert assertThat(BigDecimal actual)
BigDecimalAssert
.actual
- the actual value.public BooleanAssert assertThat(boolean actual)
BooleanAssert
.actual
- the actual value.public BooleanAssert assertThat(Boolean actual)
BooleanAssert
.actual
- the actual value.public BooleanArrayAssert assertThat(boolean[] actual)
BooleanArrayAssert
.actual
- the actual value.public ByteAssert assertThat(byte actual)
ByteAssert
.actual
- the actual value.public ByteAssert assertThat(Byte actual)
ByteAssert
.actual
- the actual value.public ByteArrayAssert assertThat(byte[] actual)
ByteArrayAssert
.actual
- the actual value.public CharacterAssert assertThat(char actual)
CharacterAssert
.actual
- the actual value.public CharArrayAssert assertThat(char[] actual)
CharArrayAssert
.actual
- the actual value.public CharacterAssert assertThat(Character actual)
CharacterAssert
.actual
- the actual value.public SoftAssertionClassAssert assertThat(Class<?> actual)
ClassAssert
We don't return ClassAssert
as it has overriden methods to annotated with SafeVarargs
.actual
- the actual value.public <T> IterableAssert<T> assertThat(Iterable<? extends T> actual)
IterableAssert
.actual
- the actual value.public <T> IterableAssert<T> assertThat(Iterator<T> actual)
actual
- the actual value.public DoubleAssert assertThat(double actual)
DoubleAssert
.actual
- the actual value.public DoubleAssert assertThat(Double actual)
DoubleAssert
.actual
- the actual value.public DoubleArrayAssert assertThat(double[] actual)
DoubleArrayAssert
.actual
- the actual value.public FileAssert assertThat(File actual)
FileAssert
.actual
- the actual value.public PathAssert assertThat(java.nio.file.Path actual)
PathAssert
actual
- the pathpublic InputStreamAssert assertThat(InputStream actual)
InputStreamAssert
.actual
- the actual value.public FloatAssert assertThat(float actual)
FloatAssert
.actual
- the actual value.public FloatAssert assertThat(Float actual)
FloatAssert
.actual
- the actual value.public FloatArrayAssert assertThat(float[] actual)
FloatArrayAssert
.actual
- the actual value.public IntegerAssert assertThat(int actual)
IntegerAssert
.actual
- the actual value.public IntArrayAssert assertThat(int[] actual)
IntArrayAssert
.actual
- the actual value.public IntegerAssert assertThat(Integer actual)
IntegerAssert
.actual
- the actual value.public <T> ListAssert<T> assertThat(List<? extends T> actual)
ListAssert
.actual
- the actual value.public LongAssert assertThat(long actual)
LongAssert
.actual
- the actual value.public LongAssert assertThat(Long actual)
LongAssert
.actual
- the actual value.public LongArrayAssert assertThat(long[] actual)
LongArrayAssert
.actual
- the actual value.public <T> ObjectAssert<T> assertThat(T actual)
ObjectAssert
.actual
- the actual value.public <T> ObjectArrayAssert<T> assertThat(T[] actual)
ObjectArrayAssert
.actual
- the actual value.public <K,V> SoftAssertionMapAssert<K,V> assertThat(Map<K,V> actual)
MapAssert
.
We don't return MapAssert
as it has overriden methods to annotated with SafeVarargs
.
actual
- the actual value.public ShortAssert assertThat(short actual)
ShortAssert
.actual
- the actual value.public ShortAssert assertThat(Short actual)
ShortAssert
.actual
- the actual value.public ShortArrayAssert assertThat(short[] actual)
ShortArrayAssert
.actual
- the actual value.public CharSequenceAssert assertThat(CharSequence actual)
CharSequenceAssert
.actual
- the actual value.public StringAssert assertThat(String actual)
StringAssert
.actual
- the actual value.public DateAssert assertThat(Date actual)
DateAssert
.actual
- the actual value.public ThrowableAssert assertThat(Throwable actual)
ThrowableAssert
.actual
- the actual value.public AbstractThrowableAssert<?,? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Throwable
more easily when used with Java 8 lambdas.
Java 8 example :
@Test
public void testException() {
SoftAssertions softly = new SoftAssertions();
softly.assertThatThrownBy(() -> { throw new Exception("boom!") }).isInstanceOf(Exception.class)
.hasMessageContaining("boom");
}
Java 7 example :
SoftAssertions softly = new SoftAssertions();
softly.assertThatThrownBy(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.Copyright © 2013-2015 AssertJ. All Rights Reserved.