Package org.fest.assertions.internal
Class Throwables
java.lang.Object
org.fest.assertions.internal.Throwables
Reusable assertions for
Throwables.- Author:
- Joel Costigliola
-
Method Summary
Modifier and TypeMethodDescriptionvoidassertHasMessage(AssertionInfo info, Throwable actual, String message) Asserts that the given actualThrowablemessage is equal to the given one.voidassertHasMessageContaining(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowablecontains with the given description.voidassertHasMessageEndingWith(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowableends with the given description.voidassertHasMessageStartingWith(AssertionInfo info, Throwable actual, String description) Asserts that the message of the actualThrowablestarts with the given description.voidassertHasNoCause(AssertionInfo info, Throwable actual) Asserts that the actualThrowabledoes not have a cause.static Throwablesinstance()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 actualThrowablemessage is equal to the given one.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.message- the expected message.- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the message of the actualThrowableis not equal to the given one.
-
assertHasNoCause
Asserts that the actualThrowabledoes not have a cause.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.- Throws:
AssertionError- if the actualThrowableisnull.AssertionError- if the actualThrowablehas a cause.
-
assertHasMessageStartingWith
Asserts that the message of the actualThrowablestarts 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 actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not start with the given description.
-
assertHasMessageContaining
Asserts that the message of the actualThrowablecontains 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 actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not contain the given description.
-
assertHasMessageEndingWith
Asserts that the message of the actualThrowableends 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 actualThrowableisnull.AssertionError- if the message of the actualThrowabledoes not end with the given description.
-