File tree Expand file tree Collapse file tree
sentry-spring-jakarta/src/test/kotlin/io/sentry/spring/jakarta/kafka Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io.sentry.spring.jakarta.kafka
22
33import io.sentry.IScopes
4+ import io.sentry.Sentry
45import io.sentry.SentryOptions
56import io.sentry.SentryTraceHeader
67import io.sentry.SentryTracer
78import io.sentry.TransactionContext
9+ import io.sentry.test.initForTest
810import java.nio.charset.StandardCharsets
11+ import kotlin.test.AfterTest
912import kotlin.test.BeforeTest
1013import kotlin.test.Test
1114import kotlin.test.assertEquals
@@ -25,6 +28,7 @@ class SentryProducerInterceptorTest {
2528
2629 @BeforeTest
2730 fun setup () {
31+ initForTest { it.dsn = " https://key@sentry.io/proj" }
2832 scopes = mock()
2933 options =
3034 SentryOptions ().apply {
@@ -34,6 +38,11 @@ class SentryProducerInterceptorTest {
3438 whenever(scopes.options).thenReturn(options)
3539 }
3640
41+ @AfterTest
42+ fun teardown () {
43+ Sentry .close()
44+ }
45+
3746 private fun createTransaction (): SentryTracer {
3847 val tx = SentryTracer (TransactionContext (" tx" , " op" ), scopes)
3948 whenever(scopes.span).thenReturn(tx)
You can’t perform that action at this time.
0 commit comments