Gretty automatically invokes this task before integration test task, referred in integrationTestTask property of gretty configuration.

Warning
Internal task, please, don’t invoke it on command line!

Effects

  1. Embedded servlet-container starts in separate java process against compiled classes and their dependencies and listens for HTTP-requests on port (default 8080).

  2. Gradle script waits until servlet-container is online.

  3. Gradle script proceeds to integration test task.

Instantiation and extension

The object called appBeforeIntegrationTest is actually an instance of AppBeforeIntegrationTestTask class, created and configured for you by Gretty. You can instantiate or even extend this class on your own:

apply plugin: 'org.akhikhl.gretty'

import org.akhikhl.gretty.AppBeforeIntegrationTestTask

task('MyBeforeIntegration', type: AppBeforeIntegrationTestTask) {
  // ...
}

class VerySpecialBeforeIntegration extends AppBeforeIntegrationTestTask {
  // ...
}

task('MyBeforeIntegration2', type: VerySpecialBeforeIntegration) {
  // ...
}

If you are going to instantiate or extend this task class yourself, make sure you’ve learned it’s properties and methods.