I am using PowerMockito.mockStatic(LogServiceImpl) in my unit test code written in SPOCK framework. Even i declared @PrepareForTest([LogServiceImpl]) at class level, i am getting org.powermock.api.mockito.ClassNotPreparedException.

Earlier it was working fine in JDK8, But when i am upgrading to open jdk 11 facing this issue.

This is the powermock version used in build.gradle file

   testCompile 'org.powermock:powermock-module-junit4-rule-agent:2.0.5'
   testCompile 'org.powermock:powermock-api-mockito2:2.0.5'

I tried the steps given in

https://github.com/powermock/powermock/issues/933

https://github.com/powermock/powermock/issues/901

Still could not resolve it.. Please help me

0

There are 0 best solutions below