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:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user