java.lang.NoClassDefFoundError: org/objenesis/ObjenesisStd

阅读更多

解决方案收集,可行  
ClassNotFoundException is result of a class loader that is not able to load a particular class.

In your case Mockito has a transitive dependency to Objenesis (it needs Objenesis for correct behavior). You are most likely trying to execute your test with Mockito on test class path, but without Objenesis.

You need to add Objenesis to your test class path.

For maven projects, be sure that:

you have declared Mockito as test dependency

    org.mockito
    mockito-core
    1.10.19
    test

to run a particular test from the command line execute
mvn test -Dtest=fullyQualifedNameToYourTestClass

你可能感兴趣的:(软件测试)