I know I could create bundles for this, but is the...
# community-support
c
I know I could create bundles for this, but is there another good way to share dependencies between jvm test suites (like, I'd presume something like 90% overlap)
Copy code
testing {
  suites {
    val test by getting(JvmTestSuite::class) {
      dependencies {
        implementation(platform(libs.spring.bom))
        implementation(libs.junit.api)
        implementation(libs.assertj)
        implementation(libs.vavr)
        implementation(project(path))

        runtimeOnly(platform(libs.spring.bom))
        runtimeOnly(libs.junit.engine)
        runtimeOnly(libs.junit.launcher)
      }
    }
    val whitebox by getting(JvmTestSuite::class) {
      dependencies {
        implementation(platform(libs.spring.bom))
        implementation(libs.junit.api)
        implementation(libs.assertj)
        implementation(libs.vavr)
        implementation(project(path))

        runtimeOnly(platform(libs.spring.bom))
        runtimeOnly(libs.junit.engine)
        runtimeOnly(libs.junit.launcher)
      }
    }
  }
}
t
I'll usually do that via convention plugins that will just add the common set of deps/config for me. IE: junit5 config, assertion lib, logger impl lib etc
s
c
well... in this case it's currently only in this 1 subproject, like 2 or 3 test suites in this one subproject using test suites.
@Sebastian Schuberth that could probably work, hadn't occurred to me
a
I sometimes use
java-test-fixtures
, and then expose the common dependencies using
testFixturesApi()
. Then in each test suite do
implementation(testFixtures(project()))
n