# Testing MVC in Spring

DevFeed: [Testing MVC in Spring](<https://devfeed.tech/articles/testing-mvc-in-spring-27292.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201801/testing-mvc-in-spring/>)

Published: 2018-01-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Spring MVC](<https://devfeed.tech/topics/spring-mvc.md>), [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [controllers](<https://devfeed.tech/tags/controllers.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [spring](<https://devfeed.tech/tags/spring.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

A practical guide to testing Spring MVC applications, covering controller tests, separate MVC test groups, minimal test contexts, @WebMvcTest, and strict JSON verification. It also explains how API tests help preserve REST contracts and keep API documentation aligned with the build.

## Source excerpt

Most of java web applications is built on top of the Spring Framework. Spring has pretty good support for testing and it is a mistake not to take advantage of features it offers. I've been developing various applications using Spring MVC for some time and I've noticed few patterns for testing that do work. Read more