Integration testing is also needed to validate and verify the results of each repository and service method. All repository transactions are dependent on the java.sql.DataSource package configured by one of the context definitions. Likewise, the services will not be working without the repository beans injected into the container. Although it needs the full configuration of Spring TestContext, this recipe does not need the creation of MockMvc just to execute these test cases.
Creating tests for DAO and service layers
Getting ready
Open the Maven project ch03-jdbc and add the following unit test cases for service and DAO layers.