Gradle does not find my tests with Kotlin and JUnit 5

No, the first comment of @JB Nizet has pointed it out: add test.useJUnitPlatform() alongside your JUnit 5 dependencies. It is the way.

http://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle

test {
    useJUnitPlatform()
}

or:

dependency {
    ...
    // junit 5
    testImplementation ('org.junit.jupiter:junit-jupiter-api')
    testCompile ('org.junit.jupiter:junit-jupiter-params')
    testRuntime ('org.junit.jupiter:junit-jupiter-engine')
    testCompile ('org.mockito:mockito-junit-jupiter')
    test.useJUnitPlatform() // fix "test events not received" bug in IDEA
}

Upvote his comment, not this answer!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)