This first recipe is about writing unit tests for a general Spring 5 web application. This will highlight the basic steps on how to start integration testing with Spring TestContext framework by validating and verifying that all the beans injected into the container are @Autowired correctly in order to build the required MVC application. This framework can be used not only for testing, but also for test-driven development methodology.
Creating tests for Spring MVC components
Getting ready
Open the previous Maven Spring ch03 and add the following MVC test cases.