O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gradle plugin for JUnit 5 in Android projects

At the time of this writing, there is no official support for JUnit 5 in Android projects. To solve this problem, an open source Gradle plugin named android-junit5 has been created (https://github.com/aurae/android-junit5). To use this plugin, first we need to specify the proper dependency in our build.gradle file:

buildscript {    dependencies {        classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.0"    }}

In order to use this plugin in our project, we need to extend our project capabilities using the clause apply plugin in our build.gradle file:

apply plugin: "com.android.application"apply plugin: "de.mannodermaus.android-junit5"dependencies {    testCompile junitJupiter()}

The android-junit5 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required