I'm reading Junit 5 User Guide. It leads me to a JUnit 5 Jupiter Gradle Sample, which is a simplest example of using Junit 5 with Gradle. In build.gradle
file, there are 2 dependencies, junit-jupiter
and junit-bom
. And in test
task, it also calls useJUnitPlatform()
function.
plugins {
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform('org.junit:junit-bom:5.7.1'))
testImplementation('org.junit.jupiter:junit-jupiter')
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
According to my knowledge, the junit-jupiter
is the aggregate artifact, which pulls the following 3 artifacts,
- junit-jupiter-api (compile dependency)
- junit-jupiter-engine (runtime dependency)
- junit-jupiter-params (for parameterized tests)
So I guess junit-jupiter
is already enough for running JUnit Jupiter in my project (correct me if I was wrong). I want to know what is junit-bom
and JUnitPlatform
for here? Can I simply get rid of them? Thanks everyone:)