Skip to content

Commit e4725b8

Browse files
committed
Merge branch 'feat/queue-instrumentation-spring-boot-4' into feat/queue-instrumentation-spring-boot-2
2 parents c96a904 + 4c3f5cd commit e4725b8

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

sentry-spring-7/src/test/kotlin/io/sentry/spring7/kafka/SentryKafkaConsumerBeanPostProcessorTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.sentry.spring7.kafka
22

3+
import io.sentry.Sentry
4+
import io.sentry.test.initForTest
5+
import kotlin.test.AfterTest
6+
import kotlin.test.BeforeTest
37
import kotlin.test.Test
48
import kotlin.test.assertSame
59
import kotlin.test.assertTrue
@@ -10,6 +14,16 @@ import org.springframework.kafka.listener.RecordInterceptor
1014

1115
class SentryKafkaConsumerBeanPostProcessorTest {
1216

17+
@BeforeTest
18+
fun setup() {
19+
initForTest { it.dsn = "https://key@sentry.io/proj" }
20+
}
21+
22+
@AfterTest
23+
fun teardown() {
24+
Sentry.close()
25+
}
26+
1327
@Test
1428
fun `wraps ConcurrentKafkaListenerContainerFactory with SentryKafkaRecordInterceptor`() {
1529
val consumerFactory = mock<ConsumerFactory<String, String>>()

sentry-spring-7/src/test/kotlin/io/sentry/spring7/kafka/SentryKafkaProducerBeanPostProcessorTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.sentry.spring7.kafka
22

3+
import io.sentry.Sentry
4+
import io.sentry.test.initForTest
5+
import kotlin.test.AfterTest
6+
import kotlin.test.BeforeTest
37
import kotlin.test.Test
48
import kotlin.test.assertEquals
59
import kotlin.test.assertSame
@@ -16,6 +20,16 @@ import org.springframework.kafka.core.ProducerPostProcessor
1620

1721
class SentryKafkaProducerBeanPostProcessorTest {
1822

23+
@BeforeTest
24+
fun setup() {
25+
initForTest { it.dsn = "https://key@sentry.io/proj" }
26+
}
27+
28+
@AfterTest
29+
fun teardown() {
30+
Sentry.close()
31+
}
32+
1933
@Test
2034
fun `registers Sentry post-processor on ProducerFactory`() {
2135
val factory = mock<ProducerFactory<String, String>>()

sentry-spring-jakarta/src/test/kotlin/io/sentry/spring/jakarta/kafka/SentryKafkaConsumerBeanPostProcessorTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.sentry.spring.jakarta.kafka
22

3+
import io.sentry.Sentry
4+
import io.sentry.test.initForTest
5+
import kotlin.test.AfterTest
6+
import kotlin.test.BeforeTest
37
import kotlin.test.Test
48
import kotlin.test.assertSame
59
import kotlin.test.assertTrue
@@ -10,6 +14,16 @@ import org.springframework.kafka.listener.RecordInterceptor
1014

1115
class SentryKafkaConsumerBeanPostProcessorTest {
1216

17+
@BeforeTest
18+
fun setup() {
19+
initForTest { it.dsn = "https://key@sentry.io/proj" }
20+
}
21+
22+
@AfterTest
23+
fun teardown() {
24+
Sentry.close()
25+
}
26+
1327
@Test
1428
fun `wraps ConcurrentKafkaListenerContainerFactory with SentryKafkaRecordInterceptor`() {
1529
val consumerFactory = mock<ConsumerFactory<String, String>>()

sentry-spring-jakarta/src/test/kotlin/io/sentry/spring/jakarta/kafka/SentryKafkaProducerBeanPostProcessorTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.sentry.spring.jakarta.kafka
22

3+
import io.sentry.Sentry
4+
import io.sentry.test.initForTest
5+
import kotlin.test.AfterTest
6+
import kotlin.test.BeforeTest
37
import kotlin.test.Test
48
import kotlin.test.assertEquals
59
import kotlin.test.assertSame
@@ -16,6 +20,16 @@ import org.springframework.kafka.core.ProducerPostProcessor
1620

1721
class SentryKafkaProducerBeanPostProcessorTest {
1822

23+
@BeforeTest
24+
fun setup() {
25+
initForTest { it.dsn = "https://key@sentry.io/proj" }
26+
}
27+
28+
@AfterTest
29+
fun teardown() {
30+
Sentry.close()
31+
}
32+
1933
@Test
2034
fun `registers Sentry post-processor on ProducerFactory`() {
2135
val factory = mock<ProducerFactory<String, String>>()

0 commit comments

Comments
 (0)