【发布时间】:2020-04-07 21:12:20
【问题描述】:
我正在使用来自 okhttp3 的 MockWebServer
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:5.5.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.5.2"
testImplementation "org.junit.jupiter:junit-jupiter-migration-support:5.0.0-M4"
testImplementation "junit:junit:4.12"
testImplementation "com.squareup.okhttp3:mockwebserver:4.2.1"
}
当我尝试使用此代码时:
mockwebserver.enqueue(MockResponse().setResponseCode(HttpURLConnection.HTTP_OK))
我得到错误:
e:无法解析以下类的超类型。请确保您在类路径中具有所需的依赖项: 类 okhttp3.mockwebserver.MockWebServer,未解析的超类型:org.junit.rules.ExternalResource
我找到了this 的对话,但它无助于解决问题。
【问题讨论】:
标签: android junit5 mockwebserver