Prev Next

Testing / Mockito Interview Questions

Difference between mock and spy.

Both mock and spy can be used to mock methods or fields. The difference is that in mock, you are creating a complete mock or fake object while in spy, there is the real object and you just spying or stubbing specific methods of it.

More Related questions...

Show more question and Answers...


Comments & Discussions