Mockito object is not an instance of declaring class

后端 未结 3 1367
太阳男子
太阳男子 2020-12-17 16:12

I haven\'t touched Mockito for a while, and I have never used it extensively. But today in some new code I wanted to use best practices so I pulled out mockito-core 2.0.54-b

3条回答
  •  别那么骄傲
    2020-12-17 16:56

    Your Java runtime version is from March 2014; plenty of bugs have been fixed in the VM ever since and you should really upgrade. I am 99% sure that this problem is related to type annotations (@NonNull) which were introduced in this version for the first time in this exact release. I am sure that your problem will go away if you upgrade your VM.

    I can successfully execute your proposed test with a recent build of the HotSpot VM.

提交回复
热议问题