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

前端 未结 4 1544
孤独总比滥情好
孤独总比滥情好 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:19

    I'm using Kotlin 1.2.61/mockito 2.15 and powermock 1.7.0RC2 DID NOT work me. The set of dependencies that did the trick for me is:

    dependencies {
        testImplementation "junit:junit:4.12"
        testImplementation "org.mockito:mockito-core:2.15.0"
        testImplementation "io.kotlintest:kotlintest:2.0.7"
        testImplementation 'org.powermock:powermock-module-junit4-rule:2.0.0-beta.5'
        testImplementation 'org.powermock:powermock-core:2.0.0-beta.5'
        testImplementation 'org.powermock:powermock-module-junit4:2.0.0-beta.5'
        testImplementation 'org.powermock:powermock-api-mockito2:2.0.0-beta.5'
    }
    

提交回复
热议问题