This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4b747b8367cadb317bc4cd3aad5827b2e425e10c
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed May 29 20:31:47 2024 +0200

    camel-tracing - Do not use deprecated code
---
 .../camel/observation/CamelMicrometerObservationTestSupport.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-observation/src/test/java/org/apache/camel/observation/CamelMicrometerObservationTestSupport.java
 
b/components/camel-observation/src/test/java/org/apache/camel/observation/CamelMicrometerObservationTestSupport.java
index 55d28c73f6d..8da596694a5 100644
--- 
a/components/camel-observation/src/test/java/org/apache/camel/observation/CamelMicrometerObservationTestSupport.java
+++ 
b/components/camel-observation/src/test/java/org/apache/camel/observation/CamelMicrometerObservationTestSupport.java
@@ -54,7 +54,6 @@ import io.opentelemetry.sdk.trace.data.SpanData;
 import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor;
 import org.apache.camel.CamelContext;
 import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.camel.tracing.SpanDecorator;
 import org.assertj.core.api.Assertions;
 import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterEach;
@@ -68,6 +67,7 @@ class CamelMicrometerObservationTestSupport extends 
CamelTestSupport {
 
     static final AttributeKey<String> CAMEL_URI_KEY = 
AttributeKey.stringKey("camel-uri");
     static final AttributeKey<String> COMPONENT_KEY = 
AttributeKey.stringKey("component");
+    static final AttributeKey<String> CAMEL_SCHEME_KEY = 
AttributeKey.stringKey("url.scheme");
     static final AttributeKey<String> PRE_KEY = AttributeKey.stringKey("pre");
     static final AttributeKey<String> POST_KEY = 
AttributeKey.stringKey("post");
 
@@ -221,8 +221,10 @@ class CamelMicrometerObservationTestSupport extends 
CamelTestSupport {
         String component = span.getAttributes().get(COMPONENT_KEY);
         assertNotNull(component);
 
+        String scheme = span.getAttributes().get(CAMEL_SCHEME_KEY);
+
         if (td.getUri() != null) {
-            assertEquals(SpanDecorator.CAMEL_COMPONENT + 
URI.create(td.getUri()).getScheme(), component, td.getLabel());
+            assertEquals(URI.create(td.getUri()).getScheme(), scheme);
         }
 
         if ("camel-seda".equals(component)) {

Reply via email to