actframework / actframework

An easy to use Java MVC server stack
http://actframework.org
Other
749 stars 126 forks source link

Unit test failed after update mockito version #371

Open greenlaw110 opened 7 years ago

greenlaw110 commented 7 years ago

after update mockito from 2.0.2-BETA to 2.10.0, got a lot of unit test failure with the following error message:

org.mockito.exceptions.base.MockitoException: 
ClassCastException occurred while creating the mockito mock :
  class to mock : 'act.app.App', loaded by classloader : 'sun.misc.Launcher$AppClassLoader@18b4aac2'
  created class : 'act.app.App$MockitoMock$1065839695', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@282cb7c7'
  proxy instance class : 'act.app.App$MockitoMock$1065839695', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@282cb7c7'
  instance creation by : ObjenesisInstantiator

You might experience classloading issues, please ask the mockito mailing-list.
rahmanhabeeb commented 6 years ago

Was this resolved? Or is there any workaround other than extending the test class with PowerMockTestCase? I am using PowerMock 1.7.1 with TestNG 6.10 and Mockito-core 2.8.9 Getting the same exception as above