File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
src/test/kotlin/io/sentry/spring/jakarta/kafka Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -256,14 +256,6 @@ public final class io/sentry/spring/jakarta/kafka/SentryKafkaProducerBeanPostPro
256256 public fun postProcessAfterInitialization (Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
257257}
258258
259- public final class io/sentry/spring/jakarta/kafka/SentryProducerInterceptor : org/apache/kafka/clients/producer/ProducerInterceptor {
260- public fun <init> (Lio/sentry/IScopes;)V
261- public fun close ()V
262- public fun configure (Ljava/util/Map;)V
263- public fun onAcknowledgement (Lorg/apache/kafka/clients/producer/RecordMetadata;Ljava/lang/Exception;)V
264- public fun onSend (Lorg/apache/kafka/clients/producer/ProducerRecord;)Lorg/apache/kafka/clients/producer/ProducerRecord;
265- }
266-
267259public final class io/sentry/spring/jakarta/kafka/SentryKafkaRecordInterceptor : org/springframework/kafka/listener/RecordInterceptor {
268260 public fun <init> (Lio/sentry/IScopes;)V
269261 public fun <init> (Lio/sentry/IScopes;Lorg/springframework/kafka/listener/RecordInterceptor;)V
@@ -273,6 +265,14 @@ public final class io/sentry/spring/jakarta/kafka/SentryKafkaRecordInterceptor :
273265 public fun success (Lorg/apache/kafka/clients/consumer/ConsumerRecord;Lorg/apache/kafka/clients/consumer/Consumer;)V
274266}
275267
268+ public final class io/sentry/spring/jakarta/kafka/SentryProducerInterceptor : org/apache/kafka/clients/producer/ProducerInterceptor {
269+ public fun <init> (Lio/sentry/IScopes;)V
270+ public fun close ()V
271+ public fun configure (Ljava/util/Map;)V
272+ public fun onAcknowledgement (Lorg/apache/kafka/clients/producer/RecordMetadata;Ljava/lang/Exception;)V
273+ public fun onSend (Lorg/apache/kafka/clients/producer/ProducerRecord;)Lorg/apache/kafka/clients/producer/ProducerRecord;
274+ }
275+
276276public class io/sentry/spring/jakarta/opentelemetry/SentryOpenTelemetryAgentWithoutAutoInitConfiguration {
277277 public fun <init> ()V
278278 public fun sentryOpenTelemetryOptionsConfiguration ()Lio/sentry/Sentry$OptionsConfiguration;
Original file line number Diff line number Diff line change @@ -3,11 +3,14 @@ package io.sentry.spring.jakarta.kafka
33import io.sentry.BaggageHeader
44import io.sentry.IScopes
55import io.sentry.ISentryLifecycleToken
6+ import io.sentry.Sentry
67import io.sentry.SentryOptions
78import io.sentry.SentryTraceHeader
89import io.sentry.SentryTracer
910import io.sentry.TransactionContext
11+ import io.sentry.test.initForTest
1012import java.nio.charset.StandardCharsets
13+ import kotlin.test.AfterTest
1114import kotlin.test.BeforeTest
1215import kotlin.test.Test
1316import kotlin.test.assertEquals
@@ -30,6 +33,7 @@ class SentryKafkaRecordInterceptorTest {
3033
3134 @BeforeTest
3235 fun setup () {
36+ initForTest { it.dsn = " https://key@sentry.io/proj" }
3337 scopes = mock()
3438 consumer = mock()
3539 lifecycleToken = mock()
@@ -51,6 +55,11 @@ class SentryKafkaRecordInterceptorTest {
5155 whenever(forkedScopes.startTransaction(any<TransactionContext >(), any())).thenReturn(tx)
5256 }
5357
58+ @AfterTest
59+ fun teardown () {
60+ Sentry .close()
61+ }
62+
5463 private fun createRecord (
5564 topic : String = "my-topic",
5665 headers : RecordHeaders = RecordHeaders (),
You can’t perform that action at this time.
0 commit comments