@@ -9,32 +9,36 @@ A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] unit tests
99``` groovy
1010buildscript {
1111 dependencies {
12- classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.0-M6 "
12+ classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.0-RC3-rev1 "
1313 }
1414}
1515```
1616
1717Snapshots of the development version are available through [ Sonatype's ` snapshots ` repository] [ sonatyperepo ] .
1818
19- ** Note** : This plugin also supports the Release Candidates of JUnit 5.
20- However, as of Android Studio 3.0 Beta 5, there is an internal issue with how tests are executed from the IDE
21- related to a removed API in JUnit 5 still accessed from Android Studio's build of IntelliJ.
22- If you run your JUnit 5 tests directly from Android Studio * right now* , they will fail with a ` NoSuchMethodError ` .
23-
24- If you are running the latest version of IDEA itself, or you only ever run tests from the command line,
25- it's safe to upgrade this plugin to the * actual* most recent version, ` 1.0.0-RC3 ` .
26-
2719## Setup
2820
2921``` groovy
3022apply plugin: "com.android.application"
3123apply plugin: "de.mannodermaus.android-junit5"
3224
3325dependencies {
34- testApi junitJupiter ()
26+ testImplementation junit5 ()
3527
3628 // (Optional) If you need "parameterized tests"
37- testApi junitParams()
29+ testImplementation junit5Params()
30+
31+ // For Android Studio users:
32+ //
33+ // All versions up to and including AS 3.0 Beta 5 use a build of IntelliJ IDEA
34+ // that depends on APIs of an outdated Milestone Release of JUnit 5.
35+ // Therefore, your tests will fail with a NoSuchMethodError
36+ // when executed from Android Studio directly.
37+ //
38+ // To prevent this, there is a separate library you can apply here.
39+ // It provides a copy of the JUnit 5 Runtime used in a more recent build
40+ // of IntelliJ, overriding the one embedded in Android Studio.
41+ testCompileOnly "de.mannodermaus.gradle.plugins:android-junit5-embedded-runtime:1.0.0-RC3-rev1"
3842}
3943```
4044
@@ -55,9 +59,9 @@ However, there are some additional properties that you can apply:
5559``` groovy
5660junitPlatform {
5761 // The JUnit Jupiter dependency version to use; matches the platform's milestone by default
58- jupiterVersion "5.0.0-M6 "
62+ jupiterVersion "5.0.0-RC3 "
5963 // The JUnit Vintage Engine dependency version to use; matches the platform's milestone by default
60- vintageVersion "4.12.0-M6 "
64+ vintageVersion "4.12.0-RC3 "
6165}
6266```
6367
0 commit comments