spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/messaging/TracingChannelInterceptorTest.java
@Test public void pollingReceive_injectsConsumerSpan() {
		channel.addInterceptor(consumerSideOnly(interceptor));

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

		assertThat(channel.receive().getHeaders())
				.containsKeys("X-B3-TraceId", "X-B3-SpanId", "X-B3-Sampled",
						"nativeHeaders");
		assertThat(spans).hasSize(1).flatExtracting(Span::kind)
				.containsExactly(Span.Kind.CONSUMER);
	}
/**
	 * We have to inject headers on a polling receive as any future processor will come later
	 */
We have to inject headers on a polling receive as any future processor will come later
We have to inject headers on a polling receive as any future processor will come later
@Test public void pollingReceive_injectsConsumerSpan() {
		channel.addInterceptor(consumerSideOnly(interceptor));
		channel.send(MessageBuilder.withPayload("foo").build());
		assertThat(channel.receive().getHeaders())
				.containsKeys("X-B3-TraceId", "X-B3-SpanId", "X-B3-Sampled",
						"nativeHeaders");
		assertThat(spans).hasSize(1).flatExtracting(Span::kind)
				.containsExactly(Span.Kind.CONSUMER);
	}
@ Test public void pollingReceive_injectsConsumerSpan ( ) { channel . addInterceptor ( consumerSideOnly ( interceptor ) ) ; channel . send ( MessageBuilder . withPayload ( "foo" ) . build ( ) ) ; assertThat ( channel . receive ( ) . getHeaders ( ) ) . containsKeys ( "X-B3-TraceId" , "X-B3-SpanId" , "X-B3-Sampled" , "nativeHeaders" ) ; assertThat ( spans ) . hasSize ( 1 ) . flatExtracting ( Span :: kind ) . containsExactly ( Span . Kind . CONSUMER ) ; }
We have to inject headers on a polling receive as any future processor will come later
We have to inject headers on a polling receive as any future processor will come later