Fixed the build
This commit is contained in:
@@ -25,7 +25,7 @@ package org.springframework.cloud.sleuth.annotation;
|
||||
class NoOpTagValueResolver implements TagValueResolver {
|
||||
|
||||
@Override
|
||||
public String resolve(Object parameter) {
|
||||
public String resolve() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class SpanTagAnnotationHandler {
|
||||
if (annotation.resolver() != NoOpTagValueResolver.class) {
|
||||
TagValueResolver tagValueResolver = this.beanFactory
|
||||
.getBean(annotation.resolver());
|
||||
return tagValueResolver.resolve(argument);
|
||||
return tagValueResolver.resolve();
|
||||
}
|
||||
else if (StringUtils.hasText(annotation.expression())) {
|
||||
return this.beanFactory.getBean(TagValueExpressionResolver.class)
|
||||
|
||||
@@ -26,9 +26,8 @@ public interface TagValueResolver {
|
||||
|
||||
/**
|
||||
* Returns the tag value for the given parameter.
|
||||
* @param parameter - parameter annotated with {@link SpanTag}
|
||||
* @return the value of the tag
|
||||
*/
|
||||
String resolve(Object parameter);
|
||||
String resolve();
|
||||
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public final class TracingChannelInterceptor extends ChannelInterceptorAdapter
|
||||
headers.setImmutable();
|
||||
Span result = this.tracer.nextSpan(extracted);
|
||||
if (extracted.context() == null && !result.isNoop()) {
|
||||
addTags(message, result, null);
|
||||
addTags(result, null);
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Created a new span " + result);
|
||||
@@ -167,7 +167,7 @@ public final class TracingChannelInterceptor extends ChannelInterceptorAdapter
|
||||
if (!span.isNoop()) {
|
||||
span.kind(Span.Kind.PRODUCER).name("send").start();
|
||||
span.remoteServiceName(REMOTE_SERVICE_NAME);
|
||||
addTags(message, span, channel);
|
||||
addTags(span, channel);
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Created a new span in pre send" + span);
|
||||
@@ -253,7 +253,7 @@ public final class TracingChannelInterceptor extends ChannelInterceptorAdapter
|
||||
if (!span.isNoop()) {
|
||||
span.kind(Span.Kind.CONSUMER).name("receive").start();
|
||||
span.remoteServiceName(REMOTE_SERVICE_NAME);
|
||||
addTags(message, span, channel);
|
||||
addTags(span, channel);
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Created a new span in post receive " + span);
|
||||
@@ -292,7 +292,7 @@ public final class TracingChannelInterceptor extends ChannelInterceptorAdapter
|
||||
if (!consumerSpan.isNoop()) {
|
||||
consumerSpan.kind(Span.Kind.CONSUMER).start();
|
||||
consumerSpan.remoteServiceName(REMOTE_SERVICE_NAME);
|
||||
addTags(message, consumerSpan, channel);
|
||||
addTags(consumerSpan, channel);
|
||||
consumerSpan.finish();
|
||||
}
|
||||
// create and scope a span for the message processor
|
||||
@@ -331,7 +331,7 @@ public final class TracingChannelInterceptor extends ChannelInterceptorAdapter
|
||||
/**
|
||||
* When an upstream context was not present, lookup keys are unlikely added
|
||||
*/
|
||||
void addTags(Message<?> message, SpanCustomizer result, MessageChannel channel) {
|
||||
void addTags(SpanCustomizer result, MessageChannel channel) {
|
||||
// TODO topic etc
|
||||
if (channel != null) {
|
||||
result.tag("channel", messageChannelName(channel));
|
||||
|
||||
@@ -106,8 +106,6 @@ class HttpClientBeanPostProcessor implements BeanPostProcessor {
|
||||
|
||||
HttpTracing httpTracing;
|
||||
|
||||
Tracer tracer;
|
||||
|
||||
HttpClientHandler<HttpClientRequest, HttpClientResponse> handler;
|
||||
|
||||
TraceContext.Injector<HttpHeaders> injector;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class NoOpTagValueResolverTests {
|
||||
|
||||
@Test
|
||||
public void should_return_null() throws Exception {
|
||||
then(new NoOpTagValueResolver().resolve("")).isNull();
|
||||
then(new NoOpTagValueResolver().resolve()).isNull();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnInterfaceMethod() {
|
||||
// tag::execution[]
|
||||
Flux<String> flux = this.testBean.testMethod5("test");
|
||||
Flux<String> flux = this.testBean.testMethod5();
|
||||
|
||||
// end::execution[]
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
@@ -148,7 +148,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnClassMethod() {
|
||||
Flux<String> flux = this.testBean.testMethod6("test");
|
||||
Flux<String> flux = this.testBean.testMethod6();
|
||||
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
|
||||
@@ -164,7 +164,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnInterfaceMethod() {
|
||||
Flux<String> flux = this.testBean.testMethod8("test");
|
||||
Flux<String> flux = this.testBean.testMethod8();
|
||||
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
|
||||
@@ -179,7 +179,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnClassMethod() {
|
||||
Flux<String> flux = this.testBean.testMethod9("test");
|
||||
Flux<String> flux = this.testBean.testMethod9();
|
||||
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
|
||||
@@ -199,7 +199,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
Flux<String> flux = this.testBean.testMethod10("test");
|
||||
Flux<String> flux = this.testBean.testMethod10();
|
||||
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
@Test
|
||||
public void shouldStartAndCloseSpanOnContinueSpanIfSpanNotSet() {
|
||||
Flux<String> flux = this.testBean.testMethod10("test");
|
||||
Flux<String> flux = this.testBean.testMethod10();
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
|
||||
Awaitility.await().untilAsserted(() -> {
|
||||
@@ -243,7 +243,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
Flux<String> flux = this.testBean.testMethod10_v2("test");
|
||||
Flux<String> flux = this.testBean.testMethod10_v2();
|
||||
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
// tag::continue_span_execution[]
|
||||
Flux<String> flux = this.testBean.testMethod11("test");
|
||||
Flux<String> flux = this.testBean.testMethod11();
|
||||
// end::continue_span_execution[]
|
||||
verifyNoSpansUntilFluxComplete(flux);
|
||||
}
|
||||
@@ -296,7 +296,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
@Test
|
||||
public void shouldAddErrorTagWhenExceptionOccurredInNewSpan() {
|
||||
try {
|
||||
Flux<String> flux = this.testBean.testMethod12("test");
|
||||
Flux<String> flux = this.testBean.testMethod12();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -428,38 +428,38 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
|
||||
// tag::custom_name_and_tag_on_annotated_method[]
|
||||
@NewSpan(name = "customNameOnTestMethod5")
|
||||
Flux<String> testMethod5(@SpanTag("testTag") String param);
|
||||
Flux<String> testMethod5();
|
||||
// end::custom_name_and_tag_on_annotated_method[]
|
||||
|
||||
Flux<String> testMethod6(String test);
|
||||
Flux<String> testMethod6();
|
||||
|
||||
Flux<String> testMethod7();
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod8")
|
||||
Flux<String> testMethod8(String param);
|
||||
Flux<String> testMethod8();
|
||||
|
||||
@NewSpan(name = "testMethod9")
|
||||
Flux<String> testMethod9(String param);
|
||||
Flux<String> testMethod9();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
Flux<String> testMethod10(@SpanTag(value = "testTag10") String param);
|
||||
Flux<String> testMethod10();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
Flux<String> testMethod10_v2(@SpanTag(key = "testTag10") String param);
|
||||
Flux<String> testMethod10_v2();
|
||||
|
||||
// tag::continue_span[]
|
||||
@ContinueSpan(log = "testMethod11")
|
||||
Flux<String> testMethod11(@SpanTag("testTag11") String param);
|
||||
Flux<String> testMethod11();
|
||||
// end::continue_span[]
|
||||
|
||||
@NewSpan
|
||||
Flux<String> testMethod12(@SpanTag("testTag12") String param);
|
||||
Flux<String> testMethod12();
|
||||
|
||||
@ContinueSpan(log = "testMethod13")
|
||||
Flux<String> testMethod13();
|
||||
|
||||
@ContinueSpan
|
||||
Flux<String> testMethod14(String param);
|
||||
Flux<String> testMethod14();
|
||||
|
||||
@NewSpan(name = "spanInTraceContext")
|
||||
Flux<Long> newSpanInTraceContext();
|
||||
@@ -527,13 +527,13 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod5(String test) {
|
||||
public Flux<String> testMethod5() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod6")
|
||||
@Override
|
||||
public Flux<String> testMethod6(@SpanTag("testTag6") String test) {
|
||||
public Flux<String> testMethod6() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@@ -543,36 +543,34 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod8(String param) {
|
||||
public Flux<String> testMethod8() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod9")
|
||||
@Override
|
||||
public Flux<String> testMethod9(String param) {
|
||||
public Flux<String> testMethod9() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod10(
|
||||
@SpanTag(value = "customTestTag10") String param) {
|
||||
public Flux<String> testMethod10() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod10_v2(
|
||||
@SpanTag(key = "customTestTag10") String param) {
|
||||
public Flux<String> testMethod10_v2() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
@Override
|
||||
public Flux<String> testMethod11(@SpanTag("customTestTag11") String param) {
|
||||
public Flux<String> testMethod11() {
|
||||
return this.testFlux;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod12(String param) {
|
||||
public Flux<String> testMethod12() {
|
||||
return Flux
|
||||
.defer(() -> Flux.error(new RuntimeException("test exception 12")));
|
||||
}
|
||||
@@ -584,7 +582,7 @@ public class SleuthSpanCreatorAspectFluxTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<String> testMethod14(String param) {
|
||||
public Flux<String> testMethod14() {
|
||||
return Flux.just(TEST_STRING1, TEST_STRING2);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,12 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.springframework.cloud.sleuth.annotation.SleuthSpanCreatorAspectMonoTests.TestBean.TEST_STRING;
|
||||
import static org.springframework.test.annotation.DirtiesContext.MethodMode.BEFORE_METHOD;
|
||||
import static reactor.core.publisher.Mono.just;
|
||||
|
||||
@SpringBootTest(classes = SleuthSpanCreatorAspectMonoTests.TestConfiguration.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
@DirtiesContext
|
||||
@DirtiesContext(methodMode = BEFORE_METHOD)
|
||||
public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
@Autowired
|
||||
@@ -140,7 +141,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnInterfaceMethod() {
|
||||
// tag::execution[]
|
||||
Mono<String> mono = this.testBean.testMethod5("test");
|
||||
Mono<String> mono = this.testBean.testMethod5();
|
||||
|
||||
// end::execution[]
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
@@ -159,7 +160,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnClassMethod() {
|
||||
Mono<String> mono = this.testBean.testMethod6("test");
|
||||
Mono<String> mono = this.testBean.testMethod6();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -177,7 +178,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnInterfaceMethod() {
|
||||
Mono<String> mono = this.testBean.testMethod8("test");
|
||||
Mono<String> mono = this.testBean.testMethod8();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -194,7 +195,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnClassMethod() {
|
||||
Mono<String> mono = this.testBean.testMethod9("test");
|
||||
Mono<String> mono = this.testBean.testMethod9();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -216,7 +217,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
Mono<String> mono = this.testBean.testMethod10("test");
|
||||
Mono<String> mono = this.testBean.testMethod10();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -241,7 +242,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
@Test
|
||||
public void shouldStartAndCloseSpanOnContinueSpanIfSpanNotSet() {
|
||||
this.testBean.testMethod10("test").block();
|
||||
this.testBean.testMethod10().block();
|
||||
|
||||
Awaitility.await().untilAsserted(() -> {
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
@@ -261,7 +262,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
Mono<String> mono = this.testBean.testMethod10_v2("test");
|
||||
Mono<String> mono = this.testBean.testMethod10_v2();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -290,7 +291,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
// tag::continue_span_execution[]
|
||||
Mono<String> mono = this.testBean.testMethod11("test");
|
||||
Mono<String> mono = this.testBean.testMethod11();
|
||||
// end::continue_span_execution[]
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -318,7 +319,7 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
@Test
|
||||
public void shouldAddErrorTagWhenExceptionOccurredInNewSpan() {
|
||||
try {
|
||||
Mono<String> mono = this.testBean.testMethod12("test");
|
||||
Mono<String> mono = this.testBean.testMethod12();
|
||||
|
||||
then(this.reporter.getSpans()).isEmpty();
|
||||
|
||||
@@ -489,32 +490,32 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
|
||||
// tag::custom_name_and_tag_on_annotated_method[]
|
||||
@NewSpan(name = "customNameOnTestMethod5")
|
||||
Mono<String> testMethod5(@SpanTag("testTag") String param);
|
||||
Mono<String> testMethod5();
|
||||
// end::custom_name_and_tag_on_annotated_method[]
|
||||
|
||||
Mono<String> testMethod6(String test);
|
||||
Mono<String> testMethod6();
|
||||
|
||||
Mono<String> testMethod7();
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod8")
|
||||
Mono<String> testMethod8(String param);
|
||||
Mono<String> testMethod8();
|
||||
|
||||
@NewSpan(name = "testMethod9")
|
||||
Mono<String> testMethod9(String param);
|
||||
Mono<String> testMethod9();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
Mono<String> testMethod10(@SpanTag(value = "testTag10") String param);
|
||||
Mono<String> testMethod10();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
Mono<String> testMethod10_v2(@SpanTag(key = "testTag10") String param);
|
||||
Mono<String> testMethod10_v2();
|
||||
|
||||
// tag::continue_span[]
|
||||
@ContinueSpan(log = "testMethod11")
|
||||
Mono<String> testMethod11(@SpanTag("testTag11") String param);
|
||||
Mono<String> testMethod11();
|
||||
// end::continue_span[]
|
||||
|
||||
@NewSpan
|
||||
Mono<String> testMethod12(@SpanTag("testTag12") String param);
|
||||
Mono<String> testMethod12();
|
||||
|
||||
@ContinueSpan(log = "testMethod13")
|
||||
Mono<String> testMethod13();
|
||||
@@ -564,13 +565,13 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<String> testMethod5(String test) {
|
||||
public Mono<String> testMethod5() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod6")
|
||||
@Override
|
||||
public Mono<String> testMethod6(@SpanTag("testTag6") String test) {
|
||||
public Mono<String> testMethod6() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@@ -580,36 +581,34 @@ public class SleuthSpanCreatorAspectMonoTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<String> testMethod8(String param) {
|
||||
public Mono<String> testMethod8() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod9")
|
||||
@Override
|
||||
public Mono<String> testMethod9(String param) {
|
||||
public Mono<String> testMethod9() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<String> testMethod10(
|
||||
@SpanTag(value = "customTestTag10") String param) {
|
||||
public Mono<String> testMethod10() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<String> testMethod10_v2(
|
||||
@SpanTag(key = "customTestTag10") String param) {
|
||||
public Mono<String> testMethod10_v2() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
@Override
|
||||
public Mono<String> testMethod11(@SpanTag("customTestTag11") String param) {
|
||||
public Mono<String> testMethod11() {
|
||||
return TEST_MONO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<String> testMethod12(String param) {
|
||||
public Mono<String> testMethod12() {
|
||||
return Mono
|
||||
.defer(() -> Mono.error(new RuntimeException("test exception 12")));
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ public class SleuthSpanCreatorAspectNegativeTests {
|
||||
void testMethod4();
|
||||
|
||||
@NewSpan(name = "testMethod5")
|
||||
void testMethod5(@SpanTag("testTag") String test);
|
||||
void testMethod5();
|
||||
|
||||
void testMethod6(String test);
|
||||
void testMethod6();
|
||||
|
||||
void testMethod7();
|
||||
|
||||
@@ -124,12 +124,12 @@ public class SleuthSpanCreatorAspectNegativeTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod5(String test) {
|
||||
public void testMethod5() {
|
||||
}
|
||||
|
||||
@NewSpan(name = "testMethod6")
|
||||
@Override
|
||||
public void testMethod6(@SpanTag("testTag6") String test) {
|
||||
public void testMethod6() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnInterfaceMethod() {
|
||||
// tag::execution[]
|
||||
this.testBean.testMethod5("test");
|
||||
this.testBean.testMethod5();
|
||||
// end::execution[]
|
||||
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
@@ -115,7 +115,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithTagWhenAnnotationOnClassMethod() {
|
||||
this.testBean.testMethod6("test");
|
||||
this.testBean.testMethod6();
|
||||
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
then(spans).hasSize(1);
|
||||
@@ -127,7 +127,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnInterfaceMethod() {
|
||||
this.testBean.testMethod8("test");
|
||||
this.testBean.testMethod8();
|
||||
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
then(spans).hasSize(1);
|
||||
@@ -138,7 +138,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
@Test
|
||||
public void shouldCreateSpanWithLogWhenAnnotationOnClassMethod() {
|
||||
this.testBean.testMethod9("test");
|
||||
this.testBean.testMethod9();
|
||||
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
then(spans).hasSize(1);
|
||||
@@ -154,7 +154,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
this.testBean.testMethod10("test");
|
||||
this.testBean.testMethod10();
|
||||
}
|
||||
finally {
|
||||
span.finish();
|
||||
@@ -173,7 +173,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
@Test
|
||||
public void shouldStartAndCloseSpanOnContinueSpanIfSpanNotSet() {
|
||||
this.testBean.testMethod10("test");
|
||||
this.testBean.testMethod10();
|
||||
|
||||
List<zipkin2.Span> spans = this.reporter.getSpans();
|
||||
then(spans).hasSize(1);
|
||||
@@ -191,7 +191,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
Span span = this.tracer.nextSpan().name("foo");
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
this.testBean.testMethod10_v2("test");
|
||||
this.testBean.testMethod10_v2();
|
||||
}
|
||||
finally {
|
||||
span.finish();
|
||||
@@ -214,7 +214,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
|
||||
// tag::continue_span_execution[]
|
||||
this.testBean.testMethod11("test");
|
||||
this.testBean.testMethod11();
|
||||
// end::continue_span_execution[]
|
||||
}
|
||||
finally {
|
||||
@@ -237,7 +237,7 @@ public class SleuthSpanCreatorAspectTests {
|
||||
@Test
|
||||
public void shouldAddErrorTagWhenExceptionOccurredInNewSpan() {
|
||||
try {
|
||||
this.testBean.testMethod12("test");
|
||||
this.testBean.testMethod12();
|
||||
}
|
||||
catch (RuntimeException ignored) {
|
||||
}
|
||||
@@ -305,32 +305,32 @@ public class SleuthSpanCreatorAspectTests {
|
||||
|
||||
// tag::custom_name_and_tag_on_annotated_method[]
|
||||
@NewSpan(name = "customNameOnTestMethod5")
|
||||
void testMethod5(@SpanTag("testTag") String param);
|
||||
void testMethod5();
|
||||
// end::custom_name_and_tag_on_annotated_method[]
|
||||
|
||||
void testMethod6(String test);
|
||||
void testMethod6();
|
||||
|
||||
void testMethod7();
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod8")
|
||||
void testMethod8(String param);
|
||||
void testMethod8();
|
||||
|
||||
@NewSpan(name = "testMethod9")
|
||||
void testMethod9(String param);
|
||||
void testMethod9();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
void testMethod10(@SpanTag(value = "testTag10") String param);
|
||||
void testMethod10();
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
void testMethod10_v2(@SpanTag(key = "testTag10") String param);
|
||||
void testMethod10_v2();
|
||||
|
||||
// tag::continue_span[]
|
||||
@ContinueSpan(log = "testMethod11")
|
||||
void testMethod11(@SpanTag("testTag11") String param);
|
||||
void testMethod11();
|
||||
// end::continue_span[]
|
||||
|
||||
@NewSpan
|
||||
void testMethod12(@SpanTag("testTag12") String param);
|
||||
void testMethod12();
|
||||
|
||||
@ContinueSpan(log = "testMethod13")
|
||||
void testMethod13();
|
||||
@@ -360,12 +360,12 @@ public class SleuthSpanCreatorAspectTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod5(String test) {
|
||||
public void testMethod5() {
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod6")
|
||||
@Override
|
||||
public void testMethod6(@SpanTag("testTag6") String test) {
|
||||
public void testMethod6() {
|
||||
|
||||
}
|
||||
|
||||
@@ -374,34 +374,34 @@ public class SleuthSpanCreatorAspectTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod8(String param) {
|
||||
public void testMethod8() {
|
||||
|
||||
}
|
||||
|
||||
@NewSpan(name = "customNameOnTestMethod9")
|
||||
@Override
|
||||
public void testMethod9(String param) {
|
||||
public void testMethod9() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod10(@SpanTag(value = "customTestTag10") String param) {
|
||||
public void testMethod10() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod10_v2(@SpanTag(key = "customTestTag10") String param) {
|
||||
public void testMethod10_v2() {
|
||||
|
||||
}
|
||||
|
||||
@ContinueSpan(log = "customTest")
|
||||
@Override
|
||||
public void testMethod11(@SpanTag("customTestTag11") String param) {
|
||||
public void testMethod11() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMethod12(String param) {
|
||||
public void testMethod12() {
|
||||
throw new RuntimeException("test exception 12");
|
||||
}
|
||||
|
||||
|
||||
@@ -103,21 +103,19 @@ public class SpanTagAnnotationHandlerTests {
|
||||
|
||||
// tag::resolver_bean[]
|
||||
@NewSpan
|
||||
public void getAnnotationForTagValueResolver(
|
||||
@SpanTag(key = "test", resolver = TagValueResolver.class) String test) {
|
||||
public void getAnnotationForTagValueResolver() {
|
||||
}
|
||||
// end::resolver_bean[]
|
||||
|
||||
// tag::spel[]
|
||||
@NewSpan
|
||||
public void getAnnotationForTagValueExpression(
|
||||
@SpanTag(key = "test", expression = "'hello' + ' characters'") String test) {
|
||||
public void getAnnotationForTagValueExpression() {
|
||||
}
|
||||
// end::spel[]
|
||||
|
||||
// tag::toString[]
|
||||
@NewSpan
|
||||
public void getAnnotationForArgumentToString(@SpanTag("test") Long param) {
|
||||
public void getAnnotationForArgumentToString() {
|
||||
}
|
||||
// end::toString[]
|
||||
|
||||
@@ -130,7 +128,7 @@ public class SpanTagAnnotationHandlerTests {
|
||||
// tag::custom_resolver[]
|
||||
@Bean(name = "myCustomTagValueResolver")
|
||||
public TagValueResolver tagValueResolver() {
|
||||
return parameter -> "Value from myCustomTagValueResolver";
|
||||
return () -> "Value from myCustomTagValueResolver";
|
||||
}
|
||||
// end::custom_resolver[]
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should().schedule(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should().schedule(
|
||||
BDDMockito.argThat(
|
||||
matcher(Callable.class, instanceOf(TraceCallable.class))),
|
||||
matcher(instanceOf(TraceCallable.class))),
|
||||
anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should().scheduleAtFixedRate(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should().scheduleWithFixedDelay(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should(never()).schedule(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should(never()).schedule(
|
||||
BDDMockito.argThat(
|
||||
matcher(Callable.class, instanceOf(TraceCallable.class))),
|
||||
matcher(instanceOf(TraceCallable.class))),
|
||||
anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should(never()).scheduleAtFixedRate(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
|
||||
then(this.scheduledExecutorService).should(never()).scheduleWithFixedDelay(
|
||||
BDDMockito.argThat(
|
||||
matcher(Runnable.class, instanceOf(TraceRunnable.class))),
|
||||
matcher(instanceOf(TraceRunnable.class))),
|
||||
anyLong(), anyLong(), any(TimeUnit.class));
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public class TraceableScheduledExecutorServiceTest {
|
||||
return (argument) -> argument.getClass().isAssignableFrom(clazz);
|
||||
}
|
||||
|
||||
<T> ArgumentMatcher<T> matcher(Class<T> clazz, Predicate predicate) {
|
||||
<T> ArgumentMatcher<T> matcher(Predicate predicate) {
|
||||
return predicate::test;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,12 @@ public final class HelloServiceOuterClass {
|
||||
private HelloServiceOuterClass() {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
public static void registerAllExtensions() {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
registerAllExtensions();
|
||||
}
|
||||
|
||||
static final com.google.protobuf.Descriptors.Descriptor internal_static_sample_grpc_HelloRequest_descriptor;
|
||||
|
||||
@@ -112,7 +112,7 @@ class ParticipantsBean {
|
||||
return this.participantsClient.getParticipants(raceId);
|
||||
}
|
||||
|
||||
public List<Object> defaultParticipants(String raceId) {
|
||||
public List<Object> defaultParticipants() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class ZipkinRestTemplateSenderConfiguration {
|
||||
ZipkinUrlExtractor zipkinUrlExtractor(final ZipkinLoadBalancer zipkinLoadBalancer) {
|
||||
return new ZipkinUrlExtractor() {
|
||||
@Override
|
||||
public URI zipkinUrl(ZipkinProperties zipkinProperties) {
|
||||
public URI zipkinUrl() {
|
||||
return zipkinLoadBalancer.instance();
|
||||
}
|
||||
};
|
||||
@@ -145,7 +145,7 @@ class ZipkinRestTemplateWrapper extends RestTemplate {
|
||||
protected <T> T doExecute(URI originalUrl, HttpMethod method,
|
||||
RequestCallback requestCallback, ResponseExtractor<T> responseExtractor)
|
||||
throws RestClientException {
|
||||
URI uri = this.extractor.zipkinUrl(this.zipkinProperties);
|
||||
URI uri = this.extractor.zipkinUrl();
|
||||
URI newUri = resolvedZipkinUri(originalUrl, uri);
|
||||
return super.doExecute(newUri, method, requestCallback, responseExtractor);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ class ZipkinRestTemplateWrapper extends RestTemplate {
|
||||
*/
|
||||
interface ZipkinUrlExtractor {
|
||||
|
||||
URI zipkinUrl(ZipkinProperties zipkinProperties);
|
||||
URI zipkinUrl();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user