Skip to content

Commit 6d2858f

Browse files
committed
fix cannot compile unit tests
1 parent 435f2c3 commit 6d2858f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/SslConfigTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package com.sunnychung.application.multiplatform.hellohttp.test
33
import com.sunnychung.application.multiplatform.hellohttp.manager.NetworkClientManager
44
import com.sunnychung.application.multiplatform.hellohttp.model.ClientCertificateKeyPair
55
import com.sunnychung.application.multiplatform.hellohttp.model.SslConfig
6-
import com.sunnychung.application.multiplatform.hellohttp.network.ApacheHttpTransportClient
6+
import com.sunnychung.application.multiplatform.hellohttp.network.SpringWebClientTransportClient
7+
//import com.sunnychung.application.multiplatform.hellohttp.network.ApacheHttpTransportClient
78
import com.sunnychung.application.multiplatform.hellohttp.util.importFrom
89
import java.io.File
910
import java.security.spec.InvalidKeySpecException
@@ -19,7 +20,8 @@ class SslConfigTest {
1920
keyPassword = password
2021
)
2122
val sslConfig = SslConfig(clientCertificateKeyPairs = listOf(keyPair))
22-
ApacheHttpTransportClient(NetworkClientManager()).createSslContext(sslConfig)
23+
// ApacheHttpTransportClient(NetworkClientManager()).createSslContext(sslConfig)
24+
SpringWebClientTransportClient(NetworkClientManager()).createSslContext(sslConfig)
2325
}
2426

2527
@Test

src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/SslContextTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package com.sunnychung.application.multiplatform.hellohttp.test
33
import com.sunnychung.application.multiplatform.hellohttp.manager.NetworkClientManager
44
import com.sunnychung.application.multiplatform.hellohttp.model.ClientCertificateKeyPair
55
import com.sunnychung.application.multiplatform.hellohttp.model.SslConfig
6+
import com.sunnychung.application.multiplatform.hellohttp.network.SpringWebClientTransportClient
67
import com.sunnychung.application.multiplatform.hellohttp.util.importCaCertificates
78
import com.sunnychung.application.multiplatform.hellohttp.util.importFrom
89
import com.sunnychung.application.multiplatform.hellohttp.util.parseCaCertificates
9-
import com.sunnychung.application.multiplatform.hellohttp.network.ApacheHttpTransportClient
10+
//import com.sunnychung.application.multiplatform.hellohttp.network.ApacheHttpTransportClient
1011
import com.sunnychung.application.multiplatform.hellohttp.network.util.DenyAllSslCertificateManager
1112
import com.sunnychung.application.multiplatform.hellohttp.network.util.MultipleTrustCertificateManager
1213
import java.io.File
@@ -17,7 +18,8 @@ import kotlin.test.assertFailsWith
1718

1819
class SslContextTest {
1920

20-
val httpClient = ApacheHttpTransportClient(NetworkClientManager())
21+
// val httpClient = ApacheHttpTransportClient(NetworkClientManager())
22+
val httpClient = SpringWebClientTransportClient(NetworkClientManager())
2123

2224
private fun verifyGoogleCertificates(trustManager: X509TrustManager) {
2325
trustManager.checkServerTrusted(

0 commit comments

Comments
 (0)