3

All my tests are running fine with "mvn test" command. However when I'm using eclipse IDE to run tests, it no longer works. I got this exception error :

org.powermock.reflect.exceptions.FieldNotFoundException: No instance field named "reporter" could be found in the class hierarchy of org.mockito.internal.MockitoCore.
    at org.powermock.reflect.internal.matcherstrategies.FieldNameMatcherStrategy.notFound(FieldNameMatcherStrategy.java:40)
    at org.powermock.reflect.internal.WhiteboxImpl.findSingleFieldUsingStrategy(WhiteboxImpl.java:501)
    at org.powermock.reflect.internal.WhiteboxImpl.findFieldInHierarchy(WhiteboxImpl.java:454)
    at org.powermock.reflect.internal.WhiteboxImpl.findFieldInHierarchy(WhiteboxImpl.java:442)

I already read some topics about that. It seems it is due to some junit/powermock versions compatibility : Unable to run JUnit test with PowerMockRunner

But I think my versions are correct :

<junit.version>4.12</junit.version>
<powermock.version>1.7.3</powermock.version>
AntonBoarf
  • 1,239
  • 15
  • 31
  • 2
    A liitle late though.Please find the answer here:https://stackoverflow.com/questions/49130081/powermockito-gives-noclassdeffounderror – CVS Mar 29 '20 at 17:58

1 Answers1

0

Maybe is an incompatible version. Please, try to check the versions: Versions

Luciana Oliveira
  • 822
  • 4
  • 14
  • 35