The purpose of this repository is to show how integration tests created using kotlin-test can be executed.
The integration tests are defined using a separate gradle source set so that they can be run separately from unit tests.
Unit tests are run automatically as part of a gradle build, but integration tests need to be explicity executed by running
gradle integrationTest
The unit tests are in a file called UnitTest.kt. There are two classes in this file:
UnitTest: uses a standard JUnit@Testannotation to define a unit test method.KotlinTestUnitTest: subclass of the kotlin-testStringSpecclass.
The integration tests are in a file called IntegrationTest.kt. There are two classes in this file:
IntegrationTest: uses a standard JUnit@Testannotation to define a unit test method.KotlinTestIntegrationTest: subclass of the kotlin-testStringSpecclass.
These files all have code that can be uncommented to check that a broken test causes the build to fail.
- Clone the repo
- Run
./gradlew build integrationTest