It looks as though Diffblue Cover Community Edition does not know how to read the val
and dependencies
sections of a Kotlin-based gradle file.
EXCERPT FROM support.log
:
395 Please add the following dependencies to your project:
396 testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
397 15:41:51.706 [WARN] [Reporting][ApplicationImpl pooled thread 83][com.diffblue.intellij.plugin.b.e] E052: Missing dependency
398 Unable to mock method inputs because a supported version of Mockito is not present on the classpath.
399 Required dependencies were not found.
400 Please add the following dependencies to your project:
401 testImplementation("org.mockito:mockito-core:5.11.0")
EXCERPT from build.grade.kts
:
val checkstyleVersion = "10.17.0" // 10.3.3 or later required for SARIF support
val javaVersion = "21" // DiffBlue doesn't support 22
val jetbrainsAnnotationsVersion = "24.1.0"
val junitVersion = "5.10.2"
val logbackVersion = "1.5.6"
val lombokVersion = "1.18.32"
val mockitoVersion = "5.11.0" // DiffBlue doesn't support 5.12.0
val pmdVersion = "7.2.0"
val spotbugsVersion = "4.8.6"
repositories {
mavenCentral()
}
dependencies {
annotationProcessor("org.projectlombok:lombok:${lombokVersion}") // Lombok's annotation processing
compileOnly("org.projectlombok:lombok:${lombokVersion}") // Lombok
implementation("ch.qos.logback:logback-classic:${logbackVersion}") // LogBack -- logging: includes Slf4j API
implementation("com.github.spotbugs:spotbugs:${spotbugsVersion}") // SpotBugs -- static code analysis
// implementation("com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}")
implementation("org.jetbrains:annotations:${jetbrainsAnnotationsVersion}") // (nullness and visibility annotations)
spotbugs("com.github.spotbugs:spotbugs:${spotbugsVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}") // JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-engine:${junitVersion}") // JUnit 5
testImplementation("org.mockito:mockito-core:${mockitoVersion}") // Mockito
}