A mock is useful for replacing an external service dependency in a unit test.
Practice this question from Quiz: JUnit and Mockito, with options and an explanation.
Question
A mock is useful for replacing an external service dependency in a unit test.
Option A — Correct answer
True
Mocks replace collaborators so the unit under test can be isolated.
Option B
False
Mocks replace collaborators so the unit under test can be isolated.