1
1
package io.sentry.ktorClient
2
2
3
3
import io.ktor.client.HttpClient
4
- import io.ktor.client.HttpClientConfig
5
4
import io.ktor.client.engine.HttpClientEngine
6
5
import io.ktor.client.engine.java.Java
7
- import io.ktor.client.engine.okhttp.OkHttp
8
- import io.ktor.client.engine.okhttp.OkHttpConfig
9
- import io.ktor.client.engine.okhttp.OkHttpEngine
10
- import io.ktor.client.plugins.plugin
11
6
import io.ktor.client.request.get
12
7
import io.ktor.client.request.post
13
8
import io.ktor.client.request.setBody
@@ -31,10 +26,8 @@ import io.sentry.SpanStatus
31
26
import io.sentry.TransactionContext
32
27
import io.sentry.exception.SentryHttpClientException
33
28
import io.sentry.mockServerRequestTimeoutMillis
34
- import io.sentry.okhttp.SentryOkHttpInterceptor
35
29
import java.util.concurrent.TimeUnit
36
30
import kotlin.test.Test
37
- import okhttp3.OkHttpClient
38
31
import kotlin.test.assertEquals
39
32
import kotlin.test.assertNotNull
40
33
import kotlin.test.assertNull
@@ -378,7 +371,7 @@ class SentryKtorClientPluginTest {
378
371
isSpanActive = false ,
379
372
optionsConfiguration = { options ->
380
373
options.setIgnoredSpanOrigins(listOf (" auto.http.ktor-client" ))
381
- }
374
+ },
382
375
)
383
376
sut.get(fixture.server.url(" /hello" ).toString())
384
377
@@ -432,23 +425,4 @@ class SentryKtorClientPluginTest {
432
425
assertTrue(baggageHeaderValues[0 ].contains(" sentry-transaction=name" ))
433
426
assertTrue(baggageHeaderValues[0 ].contains(" sentry-trace_id" ))
434
427
}
435
-
436
- @Test
437
- fun `is disabled when using OkHttp client with Sentry interceptor added to builder` () {
438
- val okHttpClient = OkHttpClient .Builder ()
439
- .addInterceptor(SentryOkHttpInterceptor ())
440
- .build()
441
- val engine = OkHttpEngine (OkHttpConfig ().apply {
442
- preconfigured = okHttpClient
443
- })
444
-
445
- val client = fixture.getSut(httpClientEngine = engine)
446
- val plugin = client.plugin(SentryKtorClientPlugin )
447
- }
448
-
449
- @Test
450
- fun `is disabled when using preconfigured OkHttp client with Sentry interceptor` () {
451
- val engine = OkHttpEngine (OkHttpConfig ())
452
- val client = fixture.getSut(httpClientEngine = engine)
453
- }
454
428
}
0 commit comments