org.spockframework.mock.CannotCreateMockException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 82#248086826
    via GitHub by kurron
    ,
    • 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)

    Users with the same issue

    johnxfly
    2 times, last one,
    Unknown visitor1 times, last one,