Class AbstractThrowsException
- java.lang.Object
-
- org.mockito.internal.stubbing.answers.AbstractThrowsException
-
- All Implemented Interfaces:
Answer<java.lang.Object>
,ValidableAnswer
- Direct Known Subclasses:
ThrowsException
,ThrowsExceptionForClassType
public abstract class AbstractThrowsException extends java.lang.Object implements Answer<java.lang.Object>, ValidableAnswer
-
-
Field Summary
Fields Modifier and Type Field Description private ConditionalStackTraceFilter
filter
-
Constructor Summary
Constructors Constructor Description AbstractThrowsException()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
answer(InvocationOnMock invocation)
protected abstract java.lang.Throwable
getThrowable()
void
validateFor(InvocationOnMock invocation)
Validation of the answer at stub time for the given invocation.
-
-
-
Field Detail
-
filter
private final ConditionalStackTraceFilter filter
-
-
Method Detail
-
getThrowable
protected abstract java.lang.Throwable getThrowable()
-
answer
public java.lang.Object answer(InvocationOnMock invocation) throws java.lang.Throwable
-
validateFor
public void validateFor(InvocationOnMock invocation)
Description copied from interface:ValidableAnswer
Validation of the answer at stub time for the given invocation.This method will be called by Mockito.
The implementation must throw an MockitoException to indicate that this answer is not valid for the given invocation. If the validation succeed the implementation must simply return without throwing.
- Specified by:
validateFor
in interfaceValidableAnswer
- Parameters:
invocation
- The stubbed invocation
-
-