I want to use the built-in JUnit 5 with the Gradle Kotlin DSL, because during build I get this warning:
WARNING: The junit-platform-gradle-plugin is deprecated a
Adding on top of accepted answer, it is also possible to use typed task configuration like:
tasks.withType { useJUnitPlatform() }
Update:
Gradle docs for reference here. Specifically Example 19 which has:
tasks.withType { options.isWarnings = true // ... }