Spring MVC Test Using MockMVC
The Spring MVC Test framework provides first class support for testing Spring MVC code with JUnit, TestNG, or any other testing framework. The goal of Spring MVC Test is to provide an effective way for testing controllers by performing requests and generating responses through the actual DispatcherServlet.