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
Throwables.
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 actualThrowableis equal to the given one.hasMessageContaining(String description) Verifies that the message of the actualThrowablecontains with the given description.hasMessageEndingWith(String description) Verifies that the message of the actualThrowableends with the given description.hasMessageStartingWith(String description) Verifies that the message of the actualThrowablestarts with the given description.Verifies that the actualThrowabledoes 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 actualThrowableis equal to the given one.- Parameters:
message- the expected message.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the message of the actualThrowableis not equal to the given one.
-
hasNoCause
Verifies that the actualThrowabledoes not have a cause.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the actualThrowablehas a cause.
-
hasMessageStartingWith
Verifies that the message of the actualThrowablestarts with the given description.- Parameters:
description- the description expected to start the actualThrowable's message.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not start with the given description.
-
hasMessageContaining
Verifies that the message of the actualThrowablecontains 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 actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not contain the given description.
-
hasMessageEndingWith
Verifies that the message of the actualThrowableends with the given description.- Parameters:
description- the description expected to end the actualThrowable's message.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not end with the given description.
-