Fixing ConcurrentModificationException
This commit is contained in:
@@ -34,7 +34,7 @@ public class ArrayListSpanAccumulator implements SpanReporter {
|
|||||||
|
|
||||||
public List<Span> getSpans() {
|
public List<Span> getSpans() {
|
||||||
synchronized (this.spans) {
|
synchronized (this.spans) {
|
||||||
return new ArrayList<>(this.spans);
|
return this.spans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class WebClientTests {
|
|||||||
then(getHeader(response, Span.TRACE_ID_NAME)).isNull();
|
then(getHeader(response, Span.TRACE_ID_NAME)).isNull();
|
||||||
then(getHeader(response, Span.SPAN_ID_NAME)).isNull();
|
then(getHeader(response, Span.SPAN_ID_NAME)).isNull();
|
||||||
then(this.listener.getSpans()).isNotEmpty();
|
then(this.listener.getSpans()).isNotEmpty();
|
||||||
Optional<Span> noTraceSpan = this.listener.getSpans().stream().filter(span ->
|
Optional<Span> noTraceSpan = new ArrayList<>(this.listener.getSpans()).stream().filter(span ->
|
||||||
"http:/notrace".equals(span.getName()) && !span.tags().isEmpty()).findFirst();
|
"http:/notrace".equals(span.getName()) && !span.tags().isEmpty()).findFirst();
|
||||||
then(noTraceSpan.isPresent()).isTrue();
|
then(noTraceSpan.isPresent()).isTrue();
|
||||||
// TODO: matches cause there is an issue with Feign not providing the full URL at the interceptor level
|
// TODO: matches cause there is an issue with Feign not providing the full URL at the interceptor level
|
||||||
|
|||||||
Reference in New Issue
Block a user