public class ThrowableSubject extends Subject<ThrowableSubject,Throwable>
Throwable subjects.Subject.Factory<SubjectT extends Subject,ActualT>| Modifier | Constructor and Description |
|---|---|
protected |
ThrowableSubject(FailureMetadata metadata,
Throwable throwable)
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
ThrowableSubject |
hasCauseThat()
Returns a new
ThrowableSubject that supports assertions on this throwable's direct
cause. |
StringSubject |
hasMessageThat()
Returns a
StringSubject to make assertions about the throwable's message. |
actual, actualAsString, actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, named, toStringprotected ThrowableSubject(FailureMetadata metadata, @NullableDecl Throwable throwable)
Subject.check().that(throwable).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 © 2019. All rights reserved.