Uses of Interface
org.mockito.stubbing.Stubber
-
Packages that use Stubber Package Description org.mockito Mockito is a mock library for java - seeMockito
class for usage.org.mockito.stubbing Stubbing related classes. -
-
Uses of Stubber in org.mockito
Methods in org.mockito that return Stubber Modifier and Type Method Description static Stubber
Mockito. doAnswer(Answer answer)
UsedoAnswer()
when you want to stub a void method with genericAnswer
.static Stubber
Mockito. doCallRealMethod()
UsedoCallRealMethod()
when you want to call the real implementation of a method.static Stubber
Mockito. doNothing()
UsedoNothing()
for setting void methods to do nothing.static Stubber
Mockito. doReturn(Object toBeReturned)
UsedoReturn()
in those rare occasions when you cannot useMockito.when(Object)
.static Stubber
Mockito. doReturn(Object toBeReturned, Object... toBeReturnedNext)
Same asMockito.doReturn(Object)
but sets consecutive values to be returned.static Stubber
Mockito. doThrow(Class<? extends Throwable> toBeThrown)
UsedoThrow()
when you want to stub the void method with an exception.static Stubber
Mockito. doThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... toBeThrownNext)
Same asMockito.doThrow(Class)
but sets consecutive exception classes to be thrown.static Stubber
Mockito. doThrow(Throwable... toBeThrown)
UsedoThrow()
when you want to stub the void method with an exception. -
Uses of Stubber in org.mockito.stubbing
Methods in org.mockito.stubbing that return Stubber Modifier and Type Method Description Stubber
BaseStubber. doAnswer(Answer answer)
Use it for stubbing consecutive calls inMockito.doAnswer(Answer)
style:Stubber
BaseStubber. doCallRealMethod()
Use it for stubbing consecutive calls inMockito.doCallRealMethod()
style.Stubber
BaseStubber. doNothing()
Use it for stubbing consecutive calls inMockito.doNothing()
style:Stubber
BaseStubber. doReturn(Object toBeReturned)
Use it for stubbing consecutive calls inMockito.doReturn(Object)
style.Stubber
BaseStubber. doReturn(Object toBeReturned, Object... nextToBeReturned)
Use it for stubbing consecutive calls inMockito.doReturn(Object)
style.Stubber
BaseStubber. doThrow(Class<? extends Throwable> toBeThrown)
Use it for stubbing consecutive calls inMockito.doThrow(Class)
style:Stubber
BaseStubber. doThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... nextToBeThrown)
Use it for stubbing consecutive calls inMockito.doThrow(Class)
style:Stubber
BaseStubber. doThrow(Throwable... toBeThrown)
Use it for stubbing consecutive calls inMockito.doThrow(Throwable[])
style:
-