InterviewSolution
Saved Bookmarks
| 1. |
When and why should we use spy? |
|
Answer» Spy is a partial mock OBJECT supported by the Mockito framework. FOLLOWING are the features of spy objects:
The main DIFFERENCE between mock and spy is that in mock, we create a complete fake object whereas, in spy, we have a hybrid of a real object and fake/stubbed methods. |
|