Testing the service layer
Service layer testing is a critical part of the enterprise application development. As mentioned previously, the service layer encapsulates the business rules that define the working application and is where a significant amount of development time is spent. Business logic evolves as the application is enhanced, new modules are added, and business rules change. The test cases for the service layer will therefore represent the evolution of the application. Well-documented test cases will enhance the knowledge base of the application lifecycle, define changes, and explain the purpose of the change. The service layer test cases will become a repository of information appreciated by all developers working on the project.
The only change required to enable service layer testing is to add the following to the testingContext.xml
file defined in the previous chapter:
<context:component-scan base-package="com.gieman.tttracker.service" />
Test case classes added to the...