Hi, I’m running some tests with Diffblue, but I’m having problems with a simple test and I would like to understand the reason for the error.
My test is:
public void testMyObjectGroup(MyObject myObject){
if(myObject.getName().equalsIgnoreCase("OBJECT_NAME_1")){
System.out.println("OBJECT_NAME_1");
myObject.setName("OBJECT_NAME_1_TEST");
} else if(myObject.getName().equalsIgnoreCase("OBJECT_NAME_2")){
System.out.println("OBJECT_NAME_2");
myObject.setName("OBJECT_NAME_2_TEST");
} else {
System.out.println("OBJECT_NAME_DEFAULT");
myObject.setName("OBJECT_NAME_DEFAULT_TEST");
}
}
public class MyObject {
private String name;
private String type;
private List<MyObject> childObjects;
... respective getter and setter methods ...
}
If I add the jersey-common dependency in my project, an error occurs when generating the tests and the following message is displayed: “Unrecoverable runtime error: Please contact Diffblue support. See https://diff.blue/E009”. If I remove this dependency, the tests are successfully generated.
An important detail is that this behavior only occurs because my class MyObject has a list of MyObject. If I remove this attribute, the tests are successfully generated, even with the dependency mentioned above added.
Additional Information:
OS: Windows 10 Enterprise, 64bit
Java: jdk1.8.0_291
IntelliJ IDE 2021.1 with Diffblue Community Edition plugin
JUnit 4.12
Dependency with problem:
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.7</version>
<scope>test</scope>
</dependency>
Error in cover-plugin.log
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] Encountered an internal error E009: Unrecoverable runtime error
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] Details: Exception: java.lang.NoSuchMethodError: org.mockito.MockSettings.stubOnly()Lorg/mockito/MockSettings;
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] Stack trace:
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > java.lang.NoSuchMethodError: org.mockito.MockSettings.stubOnly()Lorg/mockito/MockSettings;
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.spring.isolation.framework.mocks.MockUtils.createStub(MockUtils.java:39)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.mockito.isolation.MockitoProxyImpl.stub(MockitoProxyImpl.java:33)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.a.d.d(SourceFile:462)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.d.a(SourceFile:32570)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.c.e.c.a(SourceFile:37)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.e.a(SourceFile:202)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.e.a(SourceFile:130)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.fuzztest.b.d.a(SourceFile:509)
18:01:51.296 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.TimedCallableExecutor$CallableFuture.executeTask(SourceFile:30)
18:01:51.297 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.TimedExecutor$TaskQueueRunner.run(SourceFile:83)
18:01:51.297 [INFO][analyzer-service:grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.WorkerThread.run(SourceFile:198)
Error in cover-server.log
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] Encountered an internal error E009: Unrecoverable runtime error
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] Details: Exception: java.lang.NoSuchMethodError: org.mockito.MockSettings.stubOnly()Lorg/mockito/MockSettings;
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] Stack trace:
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > java.lang.NoSuchMethodError: org.mockito.MockSettings.stubOnly()Lorg/mockito/MockSettings;
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.spring.isolation.framework.mocks.MockUtils.createStub(MockUtils.java:39)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.mockito.isolation.MockitoProxyImpl.stub(MockitoProxyImpl.java:33)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.a.d.d(SourceFile:462)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.d.a(SourceFile:32570)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.c.e.c.a(SourceFile:37)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.e.a(SourceFile:202)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.tir.a.e.a(SourceFile:130)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.fuzztest.b.d.a(SourceFile:509)
18:01:51.296 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.TimedCallableExecutor$CallableFuture.executeTask(SourceFile:30)
18:01:51.297 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.TimedExecutor$TaskQueueRunner.run(SourceFile:83)
18:01:51.297 [INFO][grpc-default-executor-0][c.d.cover.c.b] > com.diffblue.cover.sandbox.execution.WorkerThread.run(SourceFile:198)