What is the key behavior of a spy?

Practice this question from Quiz: JUnit and Mockito, with options and an explanation.

Question

What is the key behavior of a spy?

Option A — Correct answer

It wraps a real object and unstubbed methods call real behavior

Spies are partial test doubles around real instances.

Option B

It cannot call real methods

Option C

It creates SQL indexes

Option D

It only works on interfaces

Quiz: JUnit and Mockito

All questions · Previous question · Next question

Open on QuizMaker