Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.internal |
Internal classes, not to be used by clients.
|
org.mockito.internal.stubbing |
Stubbing logic.
|
org.mockito.stubbing |
External stubbing related classes
|
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(Object toBeReturned)
Use doReturn() in those rare occasions when you cannot use
Mockito.when(Object) . |
static Stubber |
Mockito.doThrow(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.doAnswer(Answer answer) |
Modifier and Type | Class and Description |
---|---|
class |
StubberImpl |
Modifier and Type | Method and Description |
---|---|
Stubber |
StubberImpl.doAnswer(Answer answer) |
Stubber |
StubberImpl.doNothing() |
Stubber |
StubberImpl.doReturn(Object toBeReturned) |
Stubber |
StubberImpl.doThrow(Throwable toBeThrown) |
Modifier and Type | Method and Description |
---|---|
Stubber |
Stubber.doAnswer(Answer answer)
Use it for stubbing consecutive calls in
Mockito.doAnswer(Answer) style: |
Stubber |
Stubber.doNothing()
Use it for stubbing consecutive calls in
Mockito.doNothing() style: |
Stubber |
Stubber.doReturn(Object toBeReturned)
Use it for stubbing consecutive calls in
Mockito.doReturn(Object) style. |
Stubber |
Stubber.doThrow(Throwable toBeThrown)
Use it for stubbing consecutive calls in
Mockito.doThrow(Throwable) style: |
Copyright © 2018. All rights reserved.