Saturday, June 11, 2016

Spring Mvc Testing

Testing Spring MVC is used to test MVC applications developed in spring.To remove the dependency of the application server and few object we need to  Mock it.The web application dependency includes servlet handler , resource handler , exception handler , view handler.
This tutorial requires minimum of Junit 4.9 , javax-servlet-api 3.0.2. You might face Spring4TestRunner exception and NoClassDefFound javax.servlet.SessionCookieConfig
If there any autowired beans in your controller class you might face an exception like IllegalState Failed to load ApplicationContext
Reference:
http://blog.zenika.com/2013/01/15/spring-mvc-test-framework/
http://www.petrikainulainen.net/programming/spring-framework/unit-testing-of-spring-mvc-controllers-configuration/

No comments:

Post a Comment

ec2-user@ec2 Permission denied