How to add integration test to multiple subproject made by gradle init?

Trying to add integration test to the project build by init. This gets an exception applying: id 'foo.java-application-conventions caused by not being able to find task integrationTest in app/gradle.build (please see file below).

Moving things around did not seem to help.

Am I on the right track with this?

Maybe this could be added as an option to init?

Any pointers will be appreciated.

references here and here.

I just found some doc at your site.

None of these tell me how to sprinkle the code in the right place.

/*
 * This file was generated by the Gradle 'init' task.
 * And was modified by adding integration tests.
 */
plugins {
    id 'foo.java-application-conventions'
}
dependencies {
    implementation 'org.apache.commons:commons-text'
    implementation project(':utilities')
}
application {
    // Define the main class for the application.
    mainClass = 'foo.app.App'
}
//  added stuff below
task integrationTest(type: Test) {
    testClassesDirs = sourceSets.integrationTest.output.classesDirs
    classpath = sourceSets.integrationTest.runtimeClasspath
    outputs.upToDateWhen { false } // always run them
}
sourceSets {
    integrationTest {
        java {
            compileClasspath += main.output + test.output
            runtimeClasspath += main.output + test.output
            srcDir file('src/integration-test/java')
        }
        resources.srcDir file('src/integration-test/resources')
    }
}
configurations {
    integrationTestCompile.extendsFrom testCompile
    integrationTestRuntime.extendsFrom testRuntime
}
check.dependsOn integrationTest