Class ThrowsException
- java.lang.Object
-
- org.mockito.internal.stubbing.answers.AbstractThrowsException
-
- org.mockito.internal.stubbing.answers.ThrowsException
-
- All Implemented Interfaces:
java.io.Serializable,Answer<java.lang.Object>,ValidableAnswer
public class ThrowsException extends AbstractThrowsException implements java.io.Serializable
An answer that always throws the same throwable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate java.lang.Throwablethrowable
-
Constructor Summary
Constructors Constructor Description ThrowsException(java.lang.Throwable throwable)Creates a new answer always throwing the given throwable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ThrowablegetThrowable()-
Methods inherited from class org.mockito.internal.stubbing.answers.AbstractThrowsException
answer, validateFor
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
throwable
private final java.lang.Throwable throwable
-
-
Constructor Detail
-
ThrowsException
public ThrowsException(java.lang.Throwable throwable)
Creates a new answer always throwing the given throwable. If it is null, answer validation will fail.
-
-
Method Detail
-
getThrowable
protected java.lang.Throwable getThrowable()
- Specified by:
getThrowablein classAbstractThrowsException
-
-