Run ./gradlew -t run
or ./gradlew test
to see a demo of test resources which will:
src/testResources
If you run ./gradlew test
or ./gradlew run
, a test container will be spawned, and shutdown at the end of the build.
If you run with ./gradlew -t test
, then the container will only be stopped at the end of the whole build session, which means that you can make changes to your code and reuse containers without paying the startup price.
Last but not least, you can also start the test resources server separately, making it possible to reuse it in independent builds:
./gradlew startTestResourcesService
: starts the test resources server./gradlew run
: uses the test resources./gradlew test
: uses the same test resources./gradlew stopTestResourcesService
: stops the test resources serverPlease read the snapshot documentation for all the possible configuration options.