Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see
Mockito class for usage. |
org.mockito.internal |
Internal classes, not to be used by clients.
|
org.mockito.internal.stubbing |
Stubbing logic.
|
org.mockito.stubbing |
Stubbing related classes.
|
Modifier and Type | Field and Description |
---|---|
private Stubber |
BDDMockito.BDDStubberImpl.mockitoStubber |
Modifier and Type | Method and Description |
---|---|
static Stubber |
Mockito.doAnswer(Answer answer)
Use
doAnswer() when you want to stub a void method with generic Answer . |
static Stubber |
Mockito.doCallRealMethod()
Use
doCallRealMethod() when you want to call the real implementation of a method. |
static Stubber |
Mockito.doNothing()
Use
doNothing() for setting void methods to do nothing. |
static Stubber |
Mockito.doReturn(java.lang.Object toBeReturned)
Use
doReturn() in those rare occasions when you cannot use Mockito.when(Object) . |
static Stubber |
Mockito.doReturn(java.lang.Object toBeReturned,
java.lang.Object... toBeReturnedNext)
Same as
Mockito.doReturn(Object) but sets consecutive values to be returned. |
static Stubber |
Mockito.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown)
Use
doThrow() when you want to stub the void method with an exception. |
static Stubber |
Mockito.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown,
java.lang.Class<? extends java.lang.Throwable>... toBeThrownNext)
Same as
Mockito.doThrow(Class) but sets consecutive exception classes to be thrown. |
static Stubber |
Mockito.doThrow(java.lang.Throwable... toBeThrown)
Use
doThrow() when you want to stub the void method with an exception. |
Constructor and Description |
---|
BDDStubberImpl(Stubber mockitoStubber) |
Modifier and Type | Method and Description |
---|---|
Stubber |
MockitoCore.stubber() |
Stubber |
MockitoCore.stubber(Strictness strictness) |
Modifier and Type | Class and Description |
---|---|
class |
StubberImpl |
Modifier and Type | Method and Description |
---|---|
Stubber |
DefaultLenientStubber.doAnswer(Answer answer) |
Stubber |
StubberImpl.doAnswer(Answer answer) |
Stubber |
DefaultLenientStubber.doCallRealMethod() |
Stubber |
StubberImpl.doCallRealMethod() |
Stubber |
DefaultLenientStubber.doNothing() |
Stubber |
StubberImpl.doNothing() |
Stubber |
DefaultLenientStubber.doReturn(java.lang.Object toBeReturned) |
Stubber |
StubberImpl.doReturn(java.lang.Object toBeReturned) |
Stubber |
DefaultLenientStubber.doReturn(java.lang.Object toBeReturned,
java.lang.Object... nextToBeReturned) |
Stubber |
StubberImpl.doReturn(java.lang.Object toBeReturned,
java.lang.Object... nextToBeReturned) |
Stubber |
DefaultLenientStubber.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown) |
Stubber |
StubberImpl.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown) |
Stubber |
DefaultLenientStubber.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown,
java.lang.Class<? extends java.lang.Throwable>... nextToBeThrown) |
Stubber |
StubberImpl.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown,
java.lang.Class<? extends java.lang.Throwable>... nextToBeThrown) |
Stubber |
DefaultLenientStubber.doThrow(java.lang.Throwable... toBeThrown) |
Stubber |
StubberImpl.doThrow(java.lang.Throwable... toBeThrown) |
private static Stubber |
DefaultLenientStubber.stubber() |
Modifier and Type | Method and Description |
---|---|
Stubber |
BaseStubber.doAnswer(Answer answer)
Use it for stubbing consecutive calls in
Mockito.doAnswer(Answer) style:
|
Stubber |
BaseStubber.doCallRealMethod()
Use it for stubbing consecutive calls in
Mockito.doCallRealMethod() style. |
Stubber |
BaseStubber.doNothing()
Use it for stubbing consecutive calls in
Mockito.doNothing() style:
|
Stubber |
BaseStubber.doReturn(java.lang.Object toBeReturned)
Use it for stubbing consecutive calls in
Mockito.doReturn(Object) style. |
Stubber |
BaseStubber.doReturn(java.lang.Object toBeReturned,
java.lang.Object... nextToBeReturned)
Use it for stubbing consecutive calls in
Mockito.doReturn(Object) style. |
Stubber |
BaseStubber.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown)
Use it for stubbing consecutive calls in
Mockito.doThrow(Class) style:
|
Stubber |
BaseStubber.doThrow(java.lang.Class<? extends java.lang.Throwable> toBeThrown,
java.lang.Class<? extends java.lang.Throwable>... nextToBeThrown)
Use it for stubbing consecutive calls in
Mockito.doThrow(Class) style:
|
Stubber |
BaseStubber.doThrow(java.lang.Throwable... toBeThrown)
Use it for stubbing consecutive calls in
Mockito.doThrow(Throwable[]) style:
|