public class ThrowableSubject extends Subject<ThrowableSubject,Throwable>
Throwable
subjects.Modifier and Type | Method and Description |
---|---|
ThrowableSubject |
hasCauseThat()
Returns a new
ThrowableSubject that supports assertions on this throwable's direct
cause. |
void |
hasMessage(String expected)
Deprecated.
Use
hasMessageThat().isEqualTo(expected) instead. You may also consider
using inexact matching of the message (e.g. hasMessageThat().contains(substring) )
for less brittle tests. |
StringSubject |
hasMessageThat()
Returns a
StringSubject to make assertions about the throwable's message. |
actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failComparing, failComparing, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named, toString
@Deprecated public final void hasMessage(@NullableDecl String expected)
hasMessageThat().isEqualTo(expected)
instead. You may also consider
using inexact matching of the message (e.g. hasMessageThat().contains(substring)
)
for less brittle tests.public final StringSubject hasMessageThat()
StringSubject
to make assertions about the throwable's message.public final ThrowableSubject hasCauseThat()
ThrowableSubject
that supports assertions on this throwable's direct
cause. This method can be invoked repeatedly (e.g. assertThat(e).hasCauseThat().hasCauseThat()....
to assert on a particular indirect cause.Copyright © 2018. All rights reserved.