public class ExceptionWithWrongTypeThrownFailure extends AssertionError
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.Constructor and Description |
---|
ExceptionWithWrongTypeThrownFailure(Class<? extends Throwable> expectedType,
Throwable thrownException)
Creates a new
ExceptionWithWrongTypeThrownFailure . |
Modifier and Type | Method and Description |
---|---|
Class<? extends Throwable> |
getExpectedType()
Returns the type of the expected exception.
|
Throwable |
getThrownException()
Returns the exception that has been thrown.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ExceptionWithWrongTypeThrownFailure(Class<? extends Throwable> expectedType, Throwable thrownException)
ExceptionWithWrongTypeThrownFailure
.expectedType
- The type of the expected exception.thrownException
- the exception that has been thrown.public Class<? extends Throwable> getExpectedType()
public Throwable getThrownException()
Copyright © 2014–2017. All rights reserved.