Power Mockito 显示 org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner 的错误无法解决
Power Mockito showing error for org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner cannot be resolved
模拟class中的静态方法。
在测试中使用 PowerMockito 时 class 其显示错误为
The type org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner cannot be resolved. It is indirectly referenced from required .class files
在 gradle 项目中添加如下依赖项。
testCompile 'junit:junit:4.12'
testCompile 'org.easymock:easymock:3.1'
testCompile 'org.powermock:powermock-core:1.6.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.1'
testCompile 'org.powermock:powermock-api-mockito:1.6.1'
Able to resolve the issue.
testCompile "org.springframework:spring-test:3.1.1.RELEASE"
testCompile 'org.powermock:powermock-module-junit4-common:1.7.4'
testCompile 'org.powermock:powermock-module-junit4:1.7.4'
testCompile 'org.powermock:powermock-core:1.7.4'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'junit:junit:4.12'
testCompile 'cglib:cglib-nodep:2.2'
testCompile 'org.powermock:powermock-reflect:1.7.4'
testCompile 'org.powermock:powermock-api-support:1.7.4'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-api-mockito2:1.7.0RC4'
testCompile 'org.powermock:powermock-api-mockito-common:1.6.5'
模拟class中的静态方法。
在测试中使用 PowerMockito 时 class 其显示错误为
The type org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner cannot be resolved. It is indirectly referenced from required .class files
在 gradle 项目中添加如下依赖项。
testCompile 'junit:junit:4.12'
testCompile 'org.easymock:easymock:3.1'
testCompile 'org.powermock:powermock-core:1.6.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.1'
testCompile 'org.powermock:powermock-api-mockito:1.6.1'
Able to resolve the issue.
testCompile "org.springframework:spring-test:3.1.1.RELEASE"
testCompile 'org.powermock:powermock-module-junit4-common:1.7.4'
testCompile 'org.powermock:powermock-module-junit4:1.7.4'
testCompile 'org.powermock:powermock-core:1.7.4'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'junit:junit:4.12'
testCompile 'cglib:cglib-nodep:2.2'
testCompile 'org.powermock:powermock-reflect:1.7.4'
testCompile 'org.powermock:powermock-api-support:1.7.4'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-api-mockito2:1.7.0RC4'
testCompile 'org.powermock:powermock-api-mockito-common:1.6.5'