|
||||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||
MockitoAnnotations.Mock,
Mock or MockitoAnnotations.Mock have mock objects created for them
and injected to the fields.Answer.
Mockito.when(Object).
MethodInvocationControl interface.InjectingAnnotationEngine with the exception that it
doesn't create/injects mocks annotated with the standard annotations such as
Mock.SpyAnnotationEngine but it uses
PowerMockito.spy(Object) instead.MatchersBinder with the exception that
the InvocationMatcher is replaced and its toString method is overwritten to avoid exceptions.MockAwareVerificationMode for static method
verification.verifyNew(mockClass, times(1)) E.g:
verifyNew(ClassWithStaticMethod.class);
Above is equivalent to:
verifyNew(ClassWithStaticMethod.class, times(1));
verifyStatic(times(1)) E.g:
verifyStatic();
ClassWithStaticMethod.someStaticMethod("some arg");
Above is equivalent to:
verifyStatic(times(1));
ClassWithStaticMethod.someStaticMethod("some arg");
Although it is possible to verify a stubbed invocation, usually it's
just redundant.
Mockito.doThrow(Throwable)
Mockito.doAnswer(Answer)
Mockito.doNothing()
Mockito.doReturn(Object)
See examples in javadoc for Mockito
Mockito.doThrow(Throwable)
Mockito.doAnswer(Answer)
Mockito.doNothing()
Mockito.doReturn(Object)
See examples in javadoc for Mockito
Mockito.when(Object) method.
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||