mockito test gives no such method error when run as junit test but when jars are added manually in run confugurations, it runs well

后端 未结 5 1815
予麋鹿
予麋鹿 2020-12-05 18:15

I\'ve been facing a peculiar problem. Basically, when I run my Mockito/PowerMockito test normally i.e. \'Run as Junit Test\', it gives me the following error :



        
5条回答
  •  情话喂你
    2020-12-05 19:12

    Your IDE needs to be synchronized with Maven, which is what you're doing manually by adding the dependencies.

    Unfortunately Eclipse doesn't (or didn't) provide this behavior out-of-the-box (unlike IntelliJ which synchronizes seamlessly).

    The solution used to be done with the Maven Eclipse Plugin but looking at the docs it seems the latest way to do this is with Eclipse Maven Integration plugin for the IDE.

提交回复
热议问题