简体   繁体   中英

PowerMock throwing class not found exception in test class

I am using Play 2.6.13 and mockito-all 2.10.19 and using sbt for building. While executing sbt test, i am getting the below exception in test calsses:

initializationError failed: org.powermock.reflect.exceptions.FieldNotFoundException: Field 'fTestClass' was not found in class org.junit.internal.runners.MethodValidator.,

I am using the mockito by configuring in sbt as below: "org.mockito" % "mockito-all" % "1.10.19" % "test"

Any help.

Thanks

Seems to be known issue: https://github.com/powermock/powermock/issues/551

According to link I provided, they renamed fTestClass to simply testClass in JUnit 4.12, so I suppose you have to use more recent PowerMock lib version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM