Automating the service layer tests
Updating the pom.xml
as follows will include the service layer test cases during the Maven build process:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<skipTests>false</skipTests>
<includes>
<include>**/dao/*Test.java</include>
<include>**/service/*Test.java</include>
</includes>
<argLine>-javaagent:target/lib/spring-instrument-${spring.version}.jar</argLine>
</configuration>
</plugin>
Selecting Run | Test Project from the NetBeans menu will then execute all test cases from both the dao
and service
packages, resulting in the following output:
We leave it to you to add test cases for the remaining service layer implementations.