There are few stages in development testing. In an SDLC figure, it illustrates the different test stages in development phase.
|
In maven, we have different lifecycle. By default, using maven will help us to achieve test automation, however maven phases helps us to achieve the various stages too.
Please have a look at below figure or read the detail in here:
However we can consume a maven plugin to be able to have integration test in our code. Have a look at the following example inside your build tags:
<!-- by default failsafe will include all java file with naming: **/IT*.java, **/*IT.java, **/*ITCase.java --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.16</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins> </build> |
It is pretty simple, any java class that follows this naming convention then can be considered as Integration Test:
by default failsafe will include all java file with naming: **/IT*.java, **/*IT.java, **/*ITCase.java
Then you can have another job in your CI to execute integration test separately(mvn verify) to avoid your unit test fail.