Skip to content
Sharp

Testing · interview question

Why do teams use Mockito for mocking dependencies in tests in production code?

Multiple choiceMediumchapter-10-curatedpremiumtestingunit-testing-with-junit
Choose one answer
Answer and explanation

Correct answer

C. It allows tests to run without network dependencies.

Why

Mockito allows developers to create mock objects that simulate the behavior of real objects, enabling tests to run without relying on network or other external dependencies, thus providing a controlled environment.

Test yourself on Testing

A free test with instant, explained results. No account needed.

Start free test
All Testing questions →