5 Mayıs 2016 Perşembe

PowerMockito - Calling Real Method of a Mocked Instance

Hi all,

When writing unit test cases, sometimes we need partial mocking, that means some methods may need to be mocked, while some others not. For this, the line below may be used,

PowerMockito.doCallRealMethod().when(mockedInstance).execute(Mockito.isA(Command.class));

Have a nice day!