Skip to content
Sharp

Testing · interview question

When using Mockito, what method would you use to verify that a mocked method was called with specific arguments?

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

Correct answer

A. Verify()

Why

The verify() method in Mockito is used to check that a mocked method was called with specific arguments. This helps ensure that the code is interacting with dependencies as expected.

Test yourself on Testing

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

Start free test
All Testing questions →