1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-23 06:42:24 +03:00

Fix android tests (#7464)

This commit is contained in:
Yuri Schimke
2022-09-24 17:28:22 +01:00
committed by GitHub
parent 550fc84605
commit 37c1001453
2 changed files with 15 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ import org.opentest4j.TestAbortedException
* Run with "./gradlew :android-test:connectedCheck" and make sure ANDROID_SDK_ROOT is set.
*/
@ExtendWith(MockWebServerExtension::class)
class AndroidAsyncDnsTest(val server: MockWebServer) {
class AndroidAsyncDnsTest {
private val localhostName: String = InetAddress.getByName("localhost").canonicalHostName
private val localhost: HandshakeCertificates by lazy {
@@ -65,8 +65,11 @@ class AndroidAsyncDnsTest(val server: MockWebServer) {
.sslSocketFactory(localhost.sslSocketFactory(), localhost.trustManager)
.build()
private lateinit var server: MockWebServer
@BeforeEach
fun init() {
fun init(server: MockWebServer) {
this.server = server
server.useHttps(localhost.sslSocketFactory())
}