Test framework dependencies Tests created by Diffblue Cover make use of a testing framework, namely one of JUnit 4, JUnit Jupiter, or TestNG - these frameworks are included in the required dependencies below. These dependencies are available from the Maven Central Repository. To add it, follow the guide relevant to your build tool.
Maven
Check whether or not the test framework dependencies are already in your Gradle project. If not, follow the instructions below to add it:
Edit the build script (build.gradle
or build.gradle.kts
).
Add Maven to the repositories
section.
Copy repositories {
mavenCentral()
}
Add JUnit or TestNG to the dependencies
section:
For JUnit 4:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'junit' , name: 'junit' , version: '4.13.2'
}
Copy dependencies {
testCompile ( "junit:junit:4.13.2" )
}
For JUnit Jupiter 5:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'org.junit.jupiter' , name: 'junit-jupiter' , version: '5.8.0'
}
Copy dependencies {
testCompile ( "org.junit.jupiter:junit-jupiter:5.8.0" )
}
For TestNG:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'org.testng' , name: 'testng' , version: '7.8.0'
}
Copy dependencies {
testCompile ( "org.testng:testng:7.8.0" )
}
Gradle
Check whether or not the test framework dependencies are already in your Gradle project. If not, follow the instructions below to add it:
Edit the build script (build.gradle
or build.gradle.kts
).
Add Maven to the repositories
section.
Copy repositories {
mavenCentral()
}
Add JUnit or TestNG to the dependencies
section:
For JUnit 4:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'junit' , name: 'junit' , version: '4.13.2'
}
Copy dependencies {
testCompile ( "junit:junit:4.13.2" )
}
For JUnit Jupiter 5:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'org.junit.jupiter' , name: 'junit-jupiter' , version: '5.8.0'
}
Copy dependencies {
testCompile ( "org.junit.jupiter:junit-jupiter:5.8.0" )
}
For TestNG:
GROOVY KOTLIN
Copy dependencies {
testCompile group: 'org.testng' , name: 'testng' , version: '7.8.0'
}
Copy dependencies {
testCompile ( "org.testng:testng:7.8.0" )
}
Last updated 3 months ago