Package org.fest.assertions.internal
Class Throwables
java.lang.Object
org.fest.assertions.internal.Throwables
Reusable assertions for
Throwable
s.- Author:
- Joel Costigliola
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assertHasMessage
(AssertionInfo info, Throwable actual, String message) Asserts that the given actualThrowable
message is equal to the given one.void
assertHasMessageContaining
(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowable
contains with the given description.void
assertHasMessageEndingWith
(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowable
ends with the given description.void
assertHasMessageStartingWith
(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowable
starts with the given description.void
assertHasNoCause
(AssertionInfo info, Throwable actual) Asserts that the actualThrowable
does not have a cause.static Throwables
instance()
Returns the singleton instance of this class.
-
Method Details
-
instance
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
assertHasMessage
Asserts that the given actualThrowable
message is equal to the given one.- Parameters:
info
- contains information about the assertion.actual
- the givenThrowable
.message
- the expected message.- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
is not equal to the given one.
-
assertHasNoCause
Asserts that the actualThrowable
does not have a cause.- Parameters:
info
- contains information about the assertion.actual
- the givenThrowable
.- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the actualThrowable
has a cause.
-
assertHasMessageStartingWith
Asserts that the message of the actualThrowable
starts with the given description.- Parameters:
info
- contains information about the assertion.actual
- the givenThrowable
.description
- the description expected to start the actualThrowable
's message.- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not start with the given description.
-
assertHasMessageContaining
Asserts that the message of the actualThrowable
contains with the given description.- Parameters:
info
- contains information about the assertion.actual
- the givenThrowable
.description
- the description expected to be contained in the actualThrowable
's message.- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not contain the given description.
-
assertHasMessageEndingWith
Asserts that the message of the actualThrowable
ends with the given description.- Parameters:
info
- contains information about the assertion.actual
- the givenThrowable
.description
- the description expected to end the actualThrowable
's message.- Throws:
AssertionError
- if the actualThrowable
isnull
.AssertionError
- if the message of the actualThrowable
does not end with the given description.
-