Skip to content
Sharp

Testing · interview question

Why do teams use Mockito when testing a payment gateway in an e-commerce application in production code?

Multiple choiceEasychapter-10-curatedpremiumtestingmocking-with-mockito
Choose one answer
Answer and explanation

Correct answer

A. To avoid real network calls during tests

Why

Mockito allows you to create mock objects that simulate the behavior of real objects. This helps isolate the code under test from external systems, like a payment gateway, by avoiding real network calls.

Test yourself on Testing

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

Start free test
All Testing questions →