Unit tests can only cover a subset of the different interactions between the components of our application. To go a little further, we will need to set up acceptance tests, tests that will actually boot up the complete application and allow us to interact with its interface.
The first thing we will want to do when we add integration tests to a project is to put them in a different location to that of the unit tests.
The reason for this is, essentially, that acceptance tests are slower than unit tests. They can be part of a different integration job, such as a nightly build, and we want developers to be able to launch the different kinds of tests easily from their IDE. To do this with Gradle, we will have to add a new configuration called integrationTest
. For Gradle, a configuration is a group of artifacts and their dependencies. We already have several configurations in our project: compile
, testCompile
, and so on.
You can have a look at the...