首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到参数的testRuntime()方法[org.jun it.jupiter:jupiter engine]

找不到参数的testRuntime()方法[org.jun it.jupiter:jupiter engine]
EN

Stack Overflow用户
提问于 2022-07-31 19:35:24
回答 1查看 235关注 0票数 1

jdk 1.8.

7.3级

在我的java项目中,我想编写由Kotlin编写的单元测试。所以我试试看:

在build.gradle中:

代码语言:javascript
复制
plugins {
    id 'application'
    id "com.nocwriter.runsql" version "1.0.3"
    id 'idea'
    id "io.spring.dependency-management" version "1.0.11.RELEASE"
    id 'org.jetbrains.kotlin.jvm' version '1.7.10'
}
apply plugin: "io.spring.dependency-management"
dependencies {
    // The dependencies in the BOM will be dependency constraints in our build, but the versions in the BOM are forced for used dependencies.
    implementation enforcedPlatform('org.springframework.boot:spring-boot-dependencies:2.7.2')

    // Use dependency defined in BOM.
    // Version is not needed, because the version defined in the BOM is a dependency constraint that is used.
    implementation 'org.xerial:sqlite-jdbc'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib'
    testImplementation(
            'org.assertj:assertj-core',
            'org.junit.jupiter:junit-jupiter-api'
    )
    testRuntime('org.junit.jupiter:junit-jupiter-engine')

    // This version will be overridden by the one found in the BOM
    implementation 'log4j:log4j:1.2.17'
    implementation 'com.toedter:jcalendar:1.4'
    
}

用法:

代码语言:javascript
复制
./gradlew build

但我在这一行中有错误:

代码语言:javascript
复制
testRuntime('org.junit.jupiter:junit-jupiter-engine')

错误:

代码语言:javascript
复制
 What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method testRuntime() for arguments [org.junit.jupiter:junit-jupiter-engine] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
EN

回答 1

Stack Overflow用户

发布于 2022-11-18 15:16:40

变到

代码语言:javascript
复制
testImplementation "org.junit.jupiter:junit-jupiter-engine"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73186364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档