doAnswer()
when you want to stub a void method with generic Answer
.Mockito.doAnswer(Answer)
style:
doAnswer(answerOne).
- doCallRealMethod() - Static method in class org.mockito.Mockito
-
Use
doCallRealMethod()
when you want to call the real implementation of a method.
- doCallRealMethod() - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doCallRealMethod()
style.
- doNothing() - Static method in class org.mockito.Mockito
-
Use
doNothing()
for setting void methods to do nothing.
- doNothing() - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doNothing()
style:
doNothing().
- doReturn(Object) - Static method in class org.mockito.Mockito
-
Use
doReturn()
in those rare occasions when you cannot use Mockito.when(Object)
.
- doReturn(Object, Object...) - Static method in class org.mockito.Mockito
-
Same as
Mockito.doReturn(Object)
but sets consecutive values to be returned.
- doReturn(Object) - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doReturn(Object)
style.
- doReturn(Object, Object...) - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doReturn(Object)
style.
- doThrow(Throwable...) - Static method in class org.mockito.Mockito
-
Use
doThrow()
when you want to stub the void method with an exception.
- doThrow(Class<? extends Throwable>) - Static method in class org.mockito.Mockito
-
Use
doThrow()
when you want to stub the void method with an exception.
- doThrow(Class<? extends Throwable>, Class<? extends Throwable>...) - Static method in class org.mockito.Mockito
-
Same as
Mockito.doThrow(Class)
but sets consecutive exception classes to be thrown.
- doThrow(Throwable...) - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doThrow(Throwable[])
style:
doThrow(new RuntimeException("one")).
- doThrow(Class<? extends Throwable>) - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doThrow(Class)
style:
doThrow(RuntimeException.class).
- doThrow(Class<? extends Throwable>, Class<? extends Throwable>...) - Method in interface org.mockito.stubbing.BaseStubber
-
Use it for stubbing consecutive calls in
Mockito.doThrow(Class)
style:
doThrow(RuntimeException.class).
- doubleThat(ArgumentMatcher<Double>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom
double
argument matchers.
- doubleThat(Matcher<Double>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
-
Enables integrating hamcrest matchers that match primitive
double
arguments.
A B C D E F G H I L M N O P R S T U V W