public class ThrowableAssert extends AbstractAssert<ThrowableAssert,Throwable>
Throwables.
To create a new instance of this class, invoke .
Assertions.assertThat(Throwable)
actual, info, myself| Modifier | Constructor and Description |
|---|---|
protected |
ThrowableAssert(Throwable actual) |
| Modifier and Type | Method and Description |
|---|---|
ThrowableAssert |
hasMessage(String message)
Verifies that the message of the actual
Throwable is equal to the given one. |
ThrowableAssert |
hasMessageContaining(String description)
Verifies that the message of the actual
Throwable contains with the given description. |
ThrowableAssert |
hasMessageEndingWith(String description)
Verifies that the message of the actual
Throwable ends with the given description. |
ThrowableAssert |
hasMessageStartingWith(String description)
Verifies that the message of the actual
Throwable starts with the given description. |
ThrowableAssert |
hasNoCause()
Verifies that the actual
Throwable does not have a cause. |
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, usingComparator, usingDefaultComparatorprotected ThrowableAssert(Throwable actual)
public ThrowableAssert hasMessage(String message)
Throwable is equal to the given one.message - the expected message.AssertionError - if the actual Throwable is null.AssertionError - if the message of the actual Throwable is not equal to the given one.public ThrowableAssert hasNoCause()
Throwable does not have a cause.AssertionError - if the actual Throwable is null.AssertionError - if the actual Throwable has a cause.public ThrowableAssert hasMessageStartingWith(String description)
Throwable starts with the given description.description - the description expected to start the actual Throwable's message.AssertionError - if the actual Throwable is null.AssertionError - if the message of the actual Throwable does not start with the given description.public ThrowableAssert hasMessageContaining(String description)
Throwable contains with the given description.description - the description expected to be contained in the actual Throwable's message.AssertionError - if the actual Throwable is null.AssertionError - if the message of the actual Throwable does not contain the given description.public ThrowableAssert hasMessageEndingWith(String description)
Throwable ends with the given description.description - the description expected to end the actual Throwable's message.AssertionError - if the actual Throwable is null.AssertionError - if the message of the actual Throwable does not end with the given description.Copyright © 2013 AssertJ. All Rights Reserved.