4

I got the idea how to stub suspend functions of regular mock object and also how to stub regular method of spy object.

However, I did not find a way to stub the suspend function of spy objects.

For e.g:

If I do whenever(method).thenReturn() gives me null exception since I pass any() as parameters.I did not find a way to call

doReturn().when(suspendFunction())

For the suspend methods in spy object.

Any help will be appreciated. Thanks.

0 Answers0