It is not easy to write good automated tests as it involves to create and maintain a stable testing environment and configure the right tools. In this free less extracted from his “Test With Spring” course, Petri Kainulainen explains how to run integration tests With Maven, Spock edition.
The lesson starts with remembering the requirements for ther Maven build and explaining how to create the Maven profiles needed for this tutorial. Then it describes how to configure the source directories of the unit and integration tests. The tutorial explains how to write a simple integration test and to run it with Maven.
According to Petri Kainulainen, what you learn in this lesson is that
- We have to configure the source directories of our unit and integration tests by changing the configuration of the GMavenPlus plugin.
- We have to configure the resource directory of our integration tests by using the Build Helper Maven plugin.
- We can run our integration tests by using the Maven Failsafe plugin.
- We can skip unit and integration tests by setting the value of the skipTests property of the Maven Surefire and Maven Failsafe plugins to true.
Read the full article on https://www.testwithspring.com/lesson/running-integration-tests-with-maven-spock-edition/