// If want to use chain method calls then use 'RETURNS_DEEP_STUBS' property
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
Foo foo = mock(Foo.class, RETURNS_DEEP_STUBS);
@Mock (answer = Answers.RETURNS_DEEP_STUBS)
private Foo foo;
Answers.CALLS_REAL_METHODS
- Calls real methods instead of stubs
// When a return value of a real objects method has to be mocked, use 'spy'
Voo voo = spy(new Voo());