我想窥探
android中的Linkedlist.
List list = new LinkedList(); List spyData = Mockito.spy(list); spyData.add("xxxx");
但是,发生了异常.
java.lang.AbstractMethodError: abstract method "boolean org.mockito.internal.invocation.AbstractAwareMethod.isAbstract()" at org.mockito.internal.invocation.InvocationImpl.callRealMethod(InvocationImpl.java:109) at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:41) at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:93) at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29) at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38) at com.google.dexmaker.mockito.InvocationHandlerAdapter.invoke(InvocationHandlerAdapter.java:49) at LinkedList_Proxy.add(LinkedList_Proxy.generated) at com.app.test.testmethod(mytest.java:202) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1858)
libs的依赖关系是
dexmaker-1.2.jar dexmaker-mockito-1.2.jar mockito-core-1.10.19.jar
甚至我将mockito-core-1.10.19.jar更新为mockito-core-2.0.31-beta.jar,
问题依然存在.
但是Mockito.mock(Linkedlist.class)还可以,我对这个问题没有任何想法.
谢谢.