Are you tired of writing tests which have a lot of boilerplate code? If so, get started with Spock Framework >>

Spring MVC Test Tutorial

This tutorial helps you to write comprehensive unit and integration tests for Spring MVC controllers. After you have finished this tutorial, you can write unit and integration tests for both “normal” web application and REST APIs.

If you want to learn how to write unit and integration tests with Spring MVC Test framework, take a look at my Test With Spring Course.

My New Spring MVC Test Tutorial

I started to write a new version of my Spring MVC Test tutorial. When this tutorial is finished, it describes how you can write both unit and integration tests for Spring MVC controllers by using the Spring MVC Test framework and JUnit 5. At the moment, my new Spring MVC Test tutorial consists of these blog posts:

Archive

This section contains links to my old blog posts which are more or less outdated. However, I decided to keep these links on this page because they might be useful to people who are working with legacy applications.

Introducing: Unit Testing of Spring MVC Controllers

This three-part tutorial describes how you can write unit tests for Spring MVC controllers. This tutorial consists of the following blog posts:

If you prefer watching videos over reading blog posts, you can watch the video version of this tutorial.

Introducing: Integration Testing of Spring MVC Applications

This eight-part tutorial describes how you can write integration tests for Spring MVC applications. The parts of this tutorial are described in the following:

If you want to learn how to write unit and integration tests with Spring MVC Test framework, take a look at my Test With Spring Course.