Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Spring
Springhard

`@WebMvcTest` vs `@SpringBootTest` — when to use which?

Tags
#testing#webmvctest#springboottest
Back to categoryPractice quiz

Answer

`@WebMvcTest` is a slice test: it loads MVC components (controllers, filters) and is fast, usually with mocked dependencies. `@SpringBootTest` loads the full application context and is better for integration tests, but slower.

Related questions

Monoliths
How do you prevent performance regressions in a large monolith?
#monolith#performance#observability
Monoliths
How do you approach integration testing in a monolith without making CI too slow?
#testing#monolith#ci
Microservices
Consumer-driven contract tests: what are they and why use them?
#microservices#testing#contracts
Monoliths
How do you refactor a messy monolith without stopping feature delivery?
#refactoring#incremental#testing