Spring MVC test framework

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, @RunWith, @WebAppConfiguration, and @ContextConfiguration, to load the Spring configuration and inject the WebApplicationContext ...

Get Spring: Developing Java Applications for the Enterprise now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.