I have just started using Mockito, so not very conversant with it. I have mocked an object like this:
CInjectorFactory mockFactory = mock(CInjectorFactory.class);
Now, if I don’t stub a particular function, it doesn’t call the original CInjectorFactory’s function, and I get a ‘null’ value:
public CMainActivityHelper getMainActivityHelper()
Does this mean, that only stubbed functions are available for the mocked object? That this mocked object does not inherit the original functions from the object that is being mocked?
Thanks.
You can use :
Then, unstubbed methods will delegate to the real implementation.
Example from the
Mockito.CALLS_REAL_METHODSjavadoc :