Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by kurron
, 1 year ago
Cannot create mock for class java.time.Instant because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
via GitHub by Derbeth
, 1 year ago
Cannot create mock for class java.util.Optional because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class java.time.Instant because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.	at org.spockframework.mock.runtime.JavaMockFactory.create(JavaMockFactory.java:41)	at org.spockframework.mock.runtime.CompositeMockFactory.create(CompositeMockFactory.java:44)	at org.spockframework.lang.SpecInternals.createMock(SpecInternals.java:45)	at org.spockframework.mock.EmptyOrDummyResponse.createDummy(EmptyOrDummyResponse.java:123)	at org.spockframework.mock.EmptyOrDummyResponse.respond(EmptyOrDummyResponse.java:92)	at org.spockframework.mock.runtime.MockController.handle(MockController.java:49)	at org.spockframework.mock.runtime.JavaMockInterceptor.intercept(JavaMockInterceptor.java:72)	at org.spockframework.mock.runtime.DynamicProxyMockInterceptorAdapter.invoke(DynamicProxyMockInterceptorAdapter.java:28)	at com.transparent.molde.example.core.TemporalAcquisitionService.currentTime(TemporalAcquisitionService.groovy:35)	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)