Skip to content
Sharp

Testing · interview question

Why do teams use MockMvc in Spring tests in production code?

Multiple choiceEasychapter-10-curatedpremiumtestingcontroller-testing
Choose one answer
Answer and explanation

Correct answer

A. It allows for testing controllers without starting a web server.

Why

MockMvc allows developers to test Spring MVC controllers in isolation, without the need for deploying the entire application to a server, making it a convenient and efficient tool for unit testing.

Test yourself on Testing

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

Start free test
All Testing questions →