I’m struggling to get the community IDEA plugin to generate a test. I thought I was starting with the most basic of projects by starting a new project from Spring Initializr. I’ve left the default settings apart from selecting Gradle instead of Maven for build. I’ve not selected any other dependencies.
I’ve written a simple class and tried to get Diffblue Cover to generate tests for it but get this error.
Could not start test generator because Spring Boot Test could not be found in the classpath.: We could not start Diffblue Cover because Spring Boot Test, which is documented as a requirement for Diffblue Cover, could not be found.
I’m not entirely sure what Diffblue Cover requires. In the Gradle build file it has these dependencies
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
and if I look into IDEA’s External Libraries node I can see Gradle: org.springframework.boot:spring-boot-test:2.4.0
Here’s the class I’m trying to test
package com.example.demo;
public class DummyService {
public int addNumbers(int x, int y) {
return x + y;
}
}
I’m not sure if I’m missing something very obvious.
Many thanks,
Andy