设置一个"Jupiter API artifact"是什么意思?
What does it mean to set up a "Jupiter API artifact"?
dependencies{
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}
上面的代码似乎是添加到 build.gradle 文件的依赖项部分、gradle 项目中的 运行 junit 5 测试所必需的。但是它不起作用...
dependencies{
testCompile("org.junit.jupiter:junit-jupiter-params:5.5.2")
}
这反而有效。
Jupiter API 提供用于测试实现的基本接口和注释。它包含正确。
它 到底是怎么回事?
如果您只是无法获得测试 运行,您很可能忘记向 Gradle 询问 运行 他们。检查 Gradle 版本。
如果你有 Gradle 4.6+ ,you can 配置 test 任务,内置支持
test {
useJUnitPlatform()
}
如果您的 Gradle 较旧,那么您需要 junit-platform-gradle-plugin,即将停产。
dependencies{
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}
上面的代码似乎是添加到 build.gradle 文件的依赖项部分、gradle 项目中的 运行 junit 5 测试所必需的。但是它不起作用...
dependencies{
testCompile("org.junit.jupiter:junit-jupiter-params:5.5.2")
}
这反而有效。
Jupiter API 提供用于测试实现的基本接口和注释。它包含正确。 它 到底是怎么回事?
如果您只是无法获得测试 运行,您很可能忘记向 Gradle 询问 运行 他们。检查 Gradle 版本。
如果你有 Gradle 4.6+ ,you can 配置 test 任务,内置支持
test {
useJUnitPlatform()
}
如果您的 Gradle 较旧,那么您需要 junit-platform-gradle-plugin,即将停产。