Class ThrowsMethodExceptionAnswer
java.lang.Object
org.opendaylight.yangtools.testutils.mockito.ThrowsMethodExceptionAnswer
- All Implemented Interfaces:
Serializable
,org.mockito.stubbing.Answer<Object>
@Beta
public final class ThrowsMethodExceptionAnswer
extends Object
implements org.mockito.stubbing.Answer<Object>, Serializable
Mockito Answer which for un-stubbed methods throws an
UnstubbedMethodException (instead of Mockito's default of returning null).
Usage:
import static ...testutils.mockito.MoreAnswers.exception; Mockito.mock(YourInterface.class, exception())
- Author:
- Michael Vorburger
- See Also:
-
Mockito.mock(Class, Answer)
ThrowsException
- Serialized Form
-
Method Summary
-
Method Details
-
answer
- Specified by:
answer
in interfaceorg.mockito.stubbing.Answer<Object>
-