Prev Next

Testing / Mockito Interview Questions

What is spy in Mockito?

Mockito.spy() spies on a real object and invokes the real method. This will allow us to call all the normal methods of the object while still tracking every interaction, just as we would with a mock.

Alternatively you may use @Spy Annotation.

More Related questions...

Show more question and Answers...


Comments & Discussions