after upgrade to 2.7 ClassNotFoundException: org.mockito.exceptions.Reporter when run test

前端 未结 4 1546
孤独总比滥情好
孤独总比滥情好 2020-12-10 23:32

I try to set up junit, mokito and powermock together but when I ran a test I get ClassNotFoundException :(

testCompile \'junit:junit:4.12\'
testCompile \'org         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 00:13

    That's what worked for me:

    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-core:2.8.0'
    testCompile 'org.powermock:powermock-api-mockito2:1.7.0RC2'
    testCompile 'org.powermock:powermock-module-junit4:1.7.0'
    testCompile 'org.powermock:powermock-core:1.7.0'
    testCompile 'org.powermock:powermock-module-junit4-rule:1.7.0'
    

    using Mockito2 fixed the problem for me.

提交回复
热议问题