JUnit: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>
dependencies {
dependencies {
    testImplementation "junit:junit:4.12"
}
</syntaxhighlight>
=JUnit and Gradle=
The only configuration required to enable unit testing in a Gradle project is to apply the Java plugin and declared JUnit as testImplementation:
<syntaxhighlight lang='groovy'>
apply plugin: 'java'
repositories {
    mavenCentral()
}
dependencies {
    ...
     testImplementation "junit:junit:4.12"
     testImplementation "junit:junit:4.12"
}
}

Revision as of 07:46, 23 February 2019

External

Internal

Overview

Dependencies

dependencies {
    testImplementation "junit:junit:4.12"
}

JUnit and Gradle

The only configuration required to enable unit testing in a Gradle project is to apply the Java plugin and declared JUnit as testImplementation:

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    ...
    testImplementation "junit:junit:4.12"
}

Concepts

Test Runner

A JUnit plugin that provides custom testing behavior. Specified with @RunWith.

Annotations