When individual program units are combined and tested as a group, it is known as integration testing. The Spring Test Context framework gives first class support for the integration testing of Spring-based applications. We have defined lots of Spring-managed beans in our web application context (DispatcherServlet-context.xml
), such as services, repositories, and view resolvers, to run our application. These managed beans are instantiated during the startup of an application by the Spring framework. While performing integration testing, our test environment must also have those beans to test our application successfully. The Spring Test Context framework gives us the ability to define a test context, which is similar to the web application context (DispatcherServlet-context.xml
). Let's see how to incorporate Spring Test Context to test our ProductValidator
class.
Spring MVC Beginner's Guide
By :
Spring MVC Beginner's Guide
By:
Overview of this book
Table of Contents (19 chapters)
Spring MVC Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Configuring a Spring Development Environment
Spring MVC Architecture – Architecting Your Web Store
Control Your Store with Controllers
Working with Spring Tag Libraries
Working with View Resolver
Intercept Your Store with Interceptor
Validate Your Products with a Validator
Give REST to Your Application with Ajax
Apache Tiles and Spring Web Flow in Action
Testing Your Application
Using the Gradle Build Tool
Pop Quiz Answers
Index
Customer Reviews