This video is outdated! If you want to learn how you can write unit tests for Spring MVC controllers, you should take a look at my updated Spring MVC Test tutorial. It describes how you can write unit tests for Spring MVC controllers with JUnit 5.
This is the second part of my video tutorial which describes the unit testing of Spring MVC controllers.
This video describes how we can write unit tests for "normal" controllers. A "normal" controller is (in the context of this video) a controller which either renders a view or handles form submissions.
This video will teach us four things:
- We learn how we can get the required testing dependencies with Maven.
- We learn what are the core components of the Spring MVC Test framework and how we can use them in our unit tests.
- We learn to write unit tests for controller methods which renders a view.
- We learn how we can write unit tests for controller methods which processes form submissions.