use of org.springframework.cloud.sleuth.ExceptionMessageErrorParser in project spring-cloud-sleuth by spring-cloud.
the class TraceableExecutorServiceTests method callables.
private List callables() {
List list = new ArrayList<>();
list.add(new TraceCallable<>(this.tracing.tracer(), new DefaultSpanNamer(), new ExceptionMessageErrorParser(), () -> "foo"));
list.add((Callable) () -> "bar");
return list;
}
use of org.springframework.cloud.sleuth.ExceptionMessageErrorParser in project spring-cloud-sleuth by spring-cloud.
the class FeignRetriesTests method setup.
@Before
@After
public void setup() {
BDDMockito.given(this.beanFactory.getBean(HttpTracing.class)).willReturn(this.httpTracing);
BDDMockito.given(this.beanFactory.getBean(ErrorParser.class)).willReturn(new ExceptionMessageErrorParser());
}
use of org.springframework.cloud.sleuth.ExceptionMessageErrorParser in project spring-cloud-sleuth by spring-cloud.
the class TraceableScheduledExecutorServiceTest method beanFactory.
BeanFactory beanFactory() {
BDDMockito.given(this.beanFactory.getBean(Tracer.class)).willReturn(this.tracing.tracer());
BDDMockito.given(this.beanFactory.getBean(SpanNamer.class)).willReturn(new DefaultSpanNamer());
BDDMockito.given(this.beanFactory.getBean(ErrorParser.class)).willReturn(new ExceptionMessageErrorParser());
return this.beanFactory;
}
use of org.springframework.cloud.sleuth.ExceptionMessageErrorParser in project spring-cloud-sleuth by spring-cloud.
the class SleuthHystrixConcurrencyStrategyTest method should_wrap_callable_in_trace_callable_when_delegate_is_present.
@Test
public void should_wrap_callable_in_trace_callable_when_delegate_is_present() throws Exception {
SleuthHystrixConcurrencyStrategy strategy = new SleuthHystrixConcurrencyStrategy(this.tracing.tracer(), new DefaultSpanNamer(), new ExceptionMessageErrorParser());
Callable<String> callable = strategy.wrapCallable(() -> "hello");
then(callable).isInstanceOf(TraceCallable.class);
}
use of org.springframework.cloud.sleuth.ExceptionMessageErrorParser in project spring-cloud-sleuth by spring-cloud.
the class SleuthHystrixConcurrencyStrategyTest method should_add_trace_keys_when_span_is_created.
@Test
public void should_add_trace_keys_when_span_is_created() throws Exception {
SleuthHystrixConcurrencyStrategy strategy = new SleuthHystrixConcurrencyStrategy(this.tracing.tracer(), new DefaultSpanNamer(), new ExceptionMessageErrorParser());
Callable<String> callable = strategy.wrapCallable(() -> "hello");
callable.call();
then(callable).isInstanceOf(TraceCallable.class);
then(this.reporter.getSpans()).hasSize(1);
}
Aggregations