I\'ve been facing a peculiar problem. Basically, when I run my Mockito/PowerMockito test normally i.e. \'Run as Junit Test\', it gives me the following error :
For me mockito version was creating issues. Just remove mockito dependency if you have added explicitly in your pom file. I just removed -
testCompile 'org.mockito:mockito-all:1.9.5'
line from my gradle file. Lets power mock resolve and add mockito dependency it needs on it's own instead of you forcefully adding one which may led to conflict.
So for me dependencies are -
testCompile "org.powermock:powermock-module-junit4:1.6.4"
testCompile "org.powermock:powermock-module-junit4-rule:1.6.4"
testCompile "org.powermock:powermock-api-mockito:1.6.4"
testCompile "org.powermock:powermock-classloading-xstream:1.6.4"
other than junit and other lib dependencies you may have.