JmsTracing { public XAQueueConnection xaQueueConnection(XAQueueConnection connection) { return TracingXAConnection.create(connection, this); } JmsTracing(Builder builder); static JmsTracing create(Tracing tracing); static JmsTracing create(MessagingTracing messagingTracing); static Builder newBuilder(Tracing tracing); static Builder newBuilder(MessagingTracing messagingTracing); Connection connection(Connection connection); QueueConnection queueConnection(QueueConnection connection); TopicConnection topicConnection(TopicConnection connection); XAConnection xaConnection(XAConnection xaConnection); XAQueueConnection xaQueueConnection(XAQueueConnection connection); XATopicConnection xaTopicConnection(XATopicConnection connection); ConnectionFactory connectionFactory(ConnectionFactory connectionFactory); XAConnectionFactory xaConnectionFactory(XAConnectionFactory xaConnectionFactory); MessageListener messageListener(MessageListener messageListener, boolean addConsumerSpan); Span nextSpan(Message message);  }
@Test public void xaQueueConnection_wrapsInput() { assertThat(jmsTracing.xaQueueConnection(mock(XAQueueConnection.class))) .isInstanceOf(TracingXAConnection.class); }
@Test public void xaQueueConnection_doesntDoubleWrap() { XAQueueConnection wrapped = jmsTracing.xaQueueConnection(mock(XAQueueConnection.class)); assertThat(jmsTracing.xaQueueConnection(wrapped)) .isSameAs(wrapped); }