public class Java6AbstractStandardSoftAssertions extends AbstractSoftAssertions
AbstractStandardSoftAssertions
.AbstractStandardSoftAssertions
proxies
Constructor and Description |
---|
Java6AbstractStandardSoftAssertions() |
errorsCollected, fail, fail, fail, failBecauseExceptionWasNotThrown, proxy, shouldHaveThrown, wasSuccess
public BigDecimalAssert assertThat(BigDecimal actual)
BigDecimalAssert
.actual
- the actual value.public BigIntegerAssert assertThat(BigInteger actual)
BigInteger
.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 overridden methods to annotated with SafeVarargs
.
actual
- the actual value.public <T extends Comparable<? super T>> AbstractComparableAssert<?,T> assertThat(T actual)
GenericComparableAssert
with
standard comparison semantics.actual
- the actual value.public <T> SoftAssertionIterableAssert<T> assertThat(Iterable<? extends T> actual)
IterableAssert
.
We don't return IterableAssert
as it has overridden methods to annotated with SafeVarargs
.
actual
- the actual value.public <T> SoftAssertionIterableAssert<T> assertThat(Iterator<? extends T> actual)
IterableAssert
. The Iterator
is first
converted into an Iterable
We don't return IterableAssert
as it has overridden methods to annotated with SafeVarargs
.
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 <RESULT> FutureAssert<RESULT> assertThat(Future<RESULT> actual)
FutureAssert
.actual
- the actual valuepublic 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> SoftAssertionListAssert<T> assertThat(List<? extends T> actual)
ListAssert
.
We don't return IterableAssert
as it has overridden methods to annotated with SafeVarargs
.
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
.T
- the type of the actual value.actual
- the actual value.public <T> ObjectArrayAssert<T> assertThat(T[] actual)
ObjectArrayAssert
.T
- the type values of the actual array.actual
- the actual value.public <K,V> SoftAssertionMapAssert<K,V> assertThat(Map<K,V> actual)
MapAssert
.
We don't return MapAssert
as it has overridden methods to annotated with SafeVarargs
.
K
- the type of keys in the map.V
- the type of values in the map.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 AtomicBooleanAssert assertThat(AtomicBoolean actual)
AtomicBoolean
.actual
- the actual value.public AtomicIntegerAssert assertThat(AtomicInteger actual)
AtomicInteger
.actual
- the actual value.public AtomicIntegerArrayAssert assertThat(AtomicIntegerArray actual)
AtomicIntegerArray
.actual
- the actual value.public <OBJECT> AtomicIntegerFieldUpdaterAssert<OBJECT> assertThat(AtomicIntegerFieldUpdater<OBJECT> actual)
AtomicIntegerFieldUpdater
.OBJECT
- the type of the object holding the updatable field.actual
- the actual value.public AtomicLongAssert assertThat(AtomicLong actual)
AtomicLong
.actual
- the actual value.public AtomicLongArrayAssert assertThat(AtomicLongArray actual)
AtomicLongArray
.actual
- the actual value.public <OBJECT> AtomicLongFieldUpdaterAssert<OBJECT> assertThat(AtomicLongFieldUpdater<OBJECT> actual)
AtomicLongFieldUpdater
.OBJECT
- the type of the object holding the updatable field.actual
- the actual value.public <VALUE> AtomicReferenceAssert<VALUE> assertThat(AtomicReference<VALUE> actual)
AtomicReference
.VALUE
- the type of object referred to by the AtomicReference
.actual
- the actual value.public <ELEMENT> AtomicReferenceArrayAssert<ELEMENT> assertThat(AtomicReferenceArray<ELEMENT> actual)
AtomicReferenceArray
.ELEMENT
- the type of object referred to by the AtomicReferenceArray
.actual
- the actual value.public <FIELD,OBJECT> AtomicReferenceFieldUpdaterAssert<FIELD,OBJECT> assertThat(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 <VALUE> AtomicMarkableReferenceAssert<VALUE> assertThat(AtomicMarkableReference<VALUE> actual)
AtomicMarkableReference
.actual
- the actual value.public <VALUE> AtomicStampedReferenceAssert<VALUE> assertThat(AtomicStampedReference<VALUE> actual)
AtomicStampedReference
.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.public UriAssert assertThat(URI actual)
UriAssert
.actual
- the actual value.public AbstractUrlAssert<?> assertThat(URL actual)
UrlAssert
.actual
- the actual value.Copyright © 2013–2018 AssertJ. All rights reserved.