spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/messaging/TracingChannelInterceptorTest.java
@Test public void subscriber_removesTraceIdsFromMessage() {
		ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel();
		channel.addInterceptor(interceptor);
		List<Message<?>> messages = new ArrayList<>();
		channel.subscribe(messages::add);

		channel.send(MessageBuilder.withPayload("foo").build());

		assertThat(messages.get(0).getHeaders())
				.doesNotContainKeys("X-B3-TraceId", "X-B3-SpanId", "X-B3-Sampled");
	}
/**
	 * The subscriber consumes a message then synchronously processes it. Since we only inject trace
	 * IDs on unprocessed messages, we remove IDs to prevent accidental re-use of the same span.
	 */
The subscriber consumes a message then synchronously processes it. Since we only inject trace
IDs on unprocessed messages, we remove IDs to prevent accidental re-use of the same span.
The subscriber consumes a message then synchronously processes it . Since we only inject trace IDs on unprocessed messages we remove IDs to prevent accidental re - use of the same span .
@Test public void subscriber_removesTraceIdsFromMessage() {
		ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel();
		channel.addInterceptor(interceptor);
		List<Message<?>> messages = new ArrayList<>();
		channel.subscribe(messages::add);
		channel.send(MessageBuilder.withPayload("foo").build());
		assertThat(messages.get(0).getHeaders())
				.doesNotContainKeys("X-B3-TraceId", "X-B3-SpanId", "X-B3-Sampled");
	}
@ Test public void subscriber_removesTraceIdsFromMessage ( ) { ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel ( ) ; channel . addInterceptor ( interceptor ) ; List < Message < ? > > messages = new ArrayList < > ( ) ; channel . subscribe ( messages :: add ) ; channel . send ( MessageBuilder . withPayload ( "foo" ) . build ( ) ) ; assertThat ( messages . get ( 0 ) . getHeaders ( ) ) . doesNotContainKeys ( "X-B3-TraceId" , "X-B3-SpanId" , "X-B3-Sampled" ) ; }
The subscriber consumes a message then synchronously processes it.
The subscriber consumes a message then synchronously processes it .