'org.powermock.api.mockito.ClassNotPreparedException at PowerMockito.mockStatic() when upgrading jdk8 to JDK11
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
