diff --git a/examples/features/standard/opentracing/src/test/java/org/apache/activemq/artemis/jms/example/OpenTracingPluginTest.java b/examples/features/standard/opentracing/src/test/java/org/apache/activemq/artemis/jms/example/OpenTracingPluginTest.java index c80e3162ee..653aba695e 100644 --- a/examples/features/standard/opentracing/src/test/java/org/apache/activemq/artemis/jms/example/OpenTracingPluginTest.java +++ b/examples/features/standard/opentracing/src/test/java/org/apache/activemq/artemis/jms/example/OpenTracingPluginTest.java @@ -115,8 +115,10 @@ public class OpenTracingPluginTest { public void assertAfterDeliver() throws ActiveMQException { ServerConsumer consumer = mock(ServerConsumer.class); MessageReference reference = mock(MessageReference.class); + Message mockMessage = mock(Message.class); - when(reference.getMessage().getUserContext(Span.class)).thenReturn(span); + when(reference.getMessage()).thenReturn(mockMessage); + when(mockMessage.getUserContext(Span.class)).thenReturn(span); plugin.afterDeliver(consumer, reference);