I’ll be updating this entry with new libraries and version updates. To make sure that you don’t miss anything, subscribe to newsletter and bookmark this page.
Frameworks
JUnit4
dependencies {
testImplementation "junit:junit:4.13.2"
}
JUnit5
test {
useJUnitPlatform()
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:5.8.0"
}
Junit4 & Junit5 in one project
test {
useJUnitPlatform()
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:5.8.0"
testImplementation "junit:junit:4.13.2"
testImplementation "org.junit.vintage:junit-vintage-engine:5.8.0"
}
Kotest
test {
useJUnitPlatform()
}
dependencies {
testImplementation 'io.kotest:kotest-runner-junit5:5.0.0>'
}
Spring Boot Starter Test
dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Mocking
Mockito
dependencies{
testImplementation 'org.mockito:mockito-core:4.1.0'
}
Mockito-Kotlin
dependencies{
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:4.0.0"
}
MockK
dependencies {
testImplementation 'io.mockk:mockk:1.12.1'
}
Assertions
Kotest
dependencies {
//assertions
testImplementation 'io.kotest:kotest-assertions-core:5.0.0'
//property testing
testImplementation 'io.kotest:kotest-property:5.0.0'
}
Strikt
dependencies {
testImplementation "io.strikt:strikt-core:0.33.0"
}
AssertJ
dependencies {
testImplementation 'org.assertj:assertj-core:3.21.0'
}
Truth
dependencies {
testImplementation 'com.google.truth:truth:1.1.3'
}