Bernhard Posselt
07/09/2026, 12:30 PMtesting {
suites {
val test = named<JvmTestSuite>("test") {
useJUnitJupiter()
}
register<JvmTestSuite>("integration") {
dependencies {
implementation(project())
}
targets {
all {
testTask.configure {
useJUnitPlatform {
includeTags("integration")
}
shouldRunAfter(test)
}
}
}
}
}
}
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
@Tag("integration")
class ProductControllerTest {
@Test
fun name() {
assertEquals(1, 21)
}
}
there are also no examples on how to configure junit.
./gradlew test executes the failing test, ./gradlew integration doesn'tVampire
07/09/2026, 12:38 PMsrc/test/java, then - well - you only have it in test, not integration unless you configure the integration suite to use the same sources which would be strange and time-wasting as you then also compile twice.Bernhard Posselt
07/09/2026, 12:39 PMVampire
07/09/2026, 12:39 PMtest suite in that caseVampire
07/09/2026, 12:39 PMdoes it need to go into a separate folder?Like you configured it, yes
Bernhard Posselt
07/09/2026, 12:39 PMVampire
07/09/2026, 12:39 PMsrc/integration/javaBernhard Posselt
07/09/2026, 12:41 PMVampire
07/09/2026, 12:42 PMtesting {
suites {
named<JvmTestSuite>("test") {
useJUnitJupiter()
targets.register("integration") {
testTask.configure {
useJUnitPlatform {
includeTags("integration")
}
}
}
}
}
}Vampire
07/09/2026, 12:42 PMBernhard Posselt
07/09/2026, 12:42 PMVampire
07/09/2026, 12:43 PMVampire
07/09/2026, 12:43 PMwhen renaming the directory though it looks like I don't have access to testImplementation dependencies of the projectOf course not
Vampire
07/09/2026, 12:43 PMtest source set, not the integration source setBernhard Posselt
07/09/2026, 12:43 PMVampire
07/09/2026, 12:44 PMintegration have the same dependencies as test, you make the relevant integration... configurations extend from the according test... configurationsVampire
07/09/2026, 12:44 PMVampire
07/09/2026, 12:44 PMVampire
07/09/2026, 12:45 PMVampire
07/09/2026, 12:45 PMBernhard Posselt
07/09/2026, 12:45 PMVampire
07/09/2026, 12:46 PMBernhard Posselt
07/09/2026, 12:47 PMVampire
07/09/2026, 12:47 PMVampire
07/09/2026, 12:48 PMconfigurations.named("integrationImplementation") {
extendsFrom(configurations.testImplementation)
}
configurations.named("integrationApi") {
extendsFrom(configurations.testApi)
}
configurations.named("integrationCompileOnly") {
extendsFrom(configurations.testCompileOnly)
}
...Vampire
07/09/2026, 12:49 PMplatform(...).Bernhard Posselt
07/09/2026, 12:49 PMVampire
07/09/2026, 12:51 PMVampire
07/09/2026, 12:52 PMBernhard Posselt
07/09/2026, 12:53 PM