You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2026/05/08 07:11:15 UTC
(camel) 03/06: chore(components): test to check log span
This is an automated email from the ASF dual-hosted git repository.
squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit e18fdad6cf8212d382a7936270c5d7b4be0276b4
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu May 7 09:41:48 2026 +0200
chore(components): test to check log span
---
.../java/org/apache/camel/telemetry/SpanBeanTest.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/SpanBeanTest.java b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/SpanBeanTest.java
index 5480b7db1bda..ed2cba75226d 100644
--- a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/SpanBeanTest.java
+++ b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/SpanBeanTest.java
@@ -96,6 +96,16 @@ public class SpanBeanTest extends ExchangeTestSupport {
assertEquals(direct.getTag("spanid"), bean.getTag("parentSpan"));
assertEquals(bean.getTag("spanid"), beanMethod.getTag("parentSpan"));
assertEquals(log.getTag("spanid"), innerToLog.getTag("parentSpan"));
+
+ // Validate operations
+ assertEquals(Op.EVENT_SENT.toString(), testProducer.getTag("op"));
+ assertEquals(Op.EVENT_RECEIVED.toString(), direct.getTag("op"));
+
+ // Validate message logging
+ assertEquals("A message", innerLog.logEntries().get(0).fields().get("message"));
+ assertEquals(
+ "Exchange[ExchangePattern: InOnly, BodyType: String, Body: my-body]",
+ innerToLog.logEntries().get(0).fields().get("message"));
}
@Override
@@ -127,10 +137,10 @@ public class SpanBeanTest extends ExchangeTestSupport {
// We just simulate the creation of a span and proper nesting. In a real implementation
// it is up to the telemetry technology to do so (for example, via method annotations)
Span parentSpan = new SpanStorageManagerExchange().peek(exchange);
- Span span = mockTracer.slcm.create("mySpan", "bo", parentSpan, null);
- mockTracer.slcm.activate(span);
- mockTracer.slcm.deactivate(span);
- mockTracer.slcm.close(span);
+ Span span = mockTracer.getSpanLifecycleManager().create("mySpan", "bo", parentSpan, null);
+ mockTracer.getSpanLifecycleManager().activate(span);
+ mockTracer.getSpanLifecycleManager().deactivate(span);
+ mockTracer.getSpanLifecycleManager().close(span);
}
}