I am using JunitRunner for running unit tests written using PowerMock and Mockito .
Spring Boot Version used is
2.0.5.RELEASE
pom.xml has below dependencies
org.powermock
powermock-api-mockito2
2.0.0-beta.5
test
org.powermock
powermock-module-junit4
2.0.0-beta.5
test
org.powermock
powermock-module-junit4-rule-agent
2.0.0-beta.5
test
org.powermock
powermock-module-javaagent
2.0.0-beta.5
The test class has annotations shown below
@RunWith(JUnit4.class)
@PrepareForTest({SomeXService.class})
When I run the testcase, I am getting error shown as below
java.lang.IllegalStateException: Cannot clear JavaAgentClassRegister. Set method has not been called.
at org.powermock.api.extension.agent.Java