Package org.fest.assertions.api
Class ThrowableAssert
java.lang.Object
org.fest.assertions.api.AbstractAssert<ThrowableAssert,Throwable>
org.fest.assertions.api.ThrowableAssert
- All Implemented Interfaces:
Assert<ThrowableAssert,
,Throwable> Descriptable<ThrowableAssert>
,ExtensionPoints<ThrowableAssert,
Throwable>
Assertion methods for
Throwable
s.
To create a new instance of this class, invoke
.
Assertions.assertThat(Throwable)
- Author:
- David DIDIER, Alex Ruiz, Joel Costigliola
-
Field Summary
Fields inherited from class org.fest.assertions.api.AbstractAssert
actual, myself
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhasMessage
(String message) Verifies that the message of the actualThrowable
is equal to the given one.hasMessageContaining
(String description) Verifies that the message of the actualThrowable
contains with the given description.hasMessageEndingWith
(String description) Verifies that the message of the actualThrowable
ends with the given description.hasMessageStartingWith
(String description) Verifies that the message of the actualThrowable
starts with the given description.Verifies that the actualThrowable
does not have a cause.Methods inherited from class org.fest.assertions.api.AbstractAssert
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, 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, usingDefaultComparator
-
Constructor Details
-
ThrowableAssert
-
-
Method Details
-
hasMessage
Verifies that the message of the actualThrowable
is equal to the given one.- Parameters:
message
- the expected message.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
is not equal to the given one.
-
hasNoCause
Verifies that the actualThrowable
does not have a cause.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the actualThrowable
has a cause.
-
hasMessageStartingWith
Verifies that the message of the actualThrowable
starts with the given description.- Parameters:
description
- the description expected to start the actualThrowable
's message.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not start with the given description.
-
hasMessageContaining
Verifies that the message of the actualThrowable
contains with the given description.- Parameters:
description
- the description expected to be contained in the actualThrowable
's message.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not contain the given description.
-
hasMessageEndingWith
Verifies that the message of the actualThrowable
ends with the given description.- Parameters:
description
- the description expected to end the actualThrowable
's message.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not end with the given description.
-