The Spring MVC test framework makes unit testing and integration testing of the Spring MVC controller more meaningful by offering first class JUnit support. It helps in testing all the aspects of the controller method that have not been tested before. It allows us to test these aspects in depth without starting a web container.
In order to perform a test on the Spring MVC framework, the Spring
TestContext framework along with JUnit or TestNG makes it so simple by providing an annotation-driven unit and integration testing support. The Spring
TestContext framework can be tested by annotations such as,
@ContextConfiguration, to load the Spring configuration and inject the