Test is throwing the following exception when running against a recent version of Mockito:
org.mockito.exceptions.base.MockitoException: Unable to initialize @Spy annotated field 'boletoReference'.
Unable to create mock instance of type 'BoletoReference'
at org.mockito.internal.runners.DefaultInternalRunner$1.withBefores(DefaultInternalRunner.java:38)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:276)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.mockito.internal.runners.DefaultInternalRunner$1.run(DefaultInternalRunner.java:78)
at org.mockito.internal.runners.DefaultInternalRunner.run(DefaultInternalRunner.java:84)
at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:39)
at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:161)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.mockito.exceptions.base.MockitoException: Unable to create mock instance of type 'BoletoReference'
... 20 more
Caused by: org.mockito.internal.creation.instance.InstantiationException:
Unable to create instance of 'BoletoReference$MockitoMock$1334867616'.
Please ensure the target class has a 0-arg constructor and executes cleanly.
... 20 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.mockito.internal.creation.instance.ConstructorInstantiator.invokeConstructor(ConstructorInstantiator.java:64)
at org.mockito.internal.creation.instance.ConstructorInstantiator.withParams(ConstructorInstantiator.java:48)
at org.mockito.internal.creation.instance.ConstructorInstantiator.newInstance(ConstructorInstantiator.java:34)
at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:47)
at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:25)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
at org.mockito.Mockito.mock(Mockito.java:1798)
at org.mockito.internal.configuration.SpyAnnotationEngine.spyNewInstance(SpyAnnotationEngine.java:114)
at org.mockito.internal.configuration.SpyAnnotationEngine.process(SpyAnnotationEngine.java:65)
at org.mockito.internal.configuration.InjectingAnnotationEngine.processIndependentAnnotations(InjectingAnnotationEngine.java:59)
at org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAnnotationEngine.java:41)
at org.mockito.MockitoAnnotations.initMocks(MockitoAnnotations.java:69)
... 20 more
Caused by: java.lang.IllegalStateException: Unabled to find an EOClassDescription for objects of class br.com.doit.money.gateway.model.BoletoReference$MockitoMock$1334867616
at com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:98)
at com.webobjects.eocontrol.EOGenericRecord.<init>(EOGenericRecord.java:73)
at er.extensions.eof.ERXGenericRecord.<init>(ERXGenericRecord.java:103)
at br.com.doit.money.gateway.model.base._BoletoReference.<init>(_BoletoReference.java:14)
at br.com.doit.money.gateway.model.BoletoReference.<init>(BoletoReference.java:16)
at br.com.doit.money.gateway.model.BoletoReference$MockitoMock$1334867616.<init>(Unknown Source)
... 37 more
That is the Mockito dependency declaration in the pom.xml.
Test is throwing the following exception when running against a recent version of Mockito:
That is the Mockito dependency declaration in the pom.xml.