Class ExceptionWithWrongTypeThrownFailure
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
com.github.stefanbirkner.fishbowl.ExceptionWithWrongTypeThrownFailure
- All Implemented Interfaces:
Serializable
This exception is thrown by
Fishbowl.exceptionThrownBy(Statement, java.lang.Class)
if the provided Statement
did throw an exception that does not have the specified type. It
extends AssertionError
in order to trigger a test
failure.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExceptionWithWrongTypeThrownFailure
(Class<? extends Throwable> expectedType, Throwable thrownException) Creates a newExceptionWithWrongTypeThrownFailure
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of the expected exception.Returns the exception that has been thrown.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
expectedType
-
-
Constructor Details
-
ExceptionWithWrongTypeThrownFailure
public ExceptionWithWrongTypeThrownFailure(Class<? extends Throwable> expectedType, Throwable thrownException) Creates a newExceptionWithWrongTypeThrownFailure
.- Parameters:
expectedType
- The type of the expected exception.thrownException
- the exception that has been thrown.
-
-
Method Details
-
getExpectedType
Returns the type of the expected exception.- Returns:
- the type of the expected exception.
-
getThrownException
Returns the exception that has been thrown.- Returns:
- the exception that has been thrown.
-