Skip to content

Commit db95e00

Browse files
committed
spotless
1 parent e0785d5 commit db95e00

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaConfigurablePropagator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurablePropagatorProvider;
1111

1212
/**
13-
* A {@link ConfigurablePropagatorProvider} which allows enabling the {@link AwsXrayLambdaPropagator}
14-
* with the propagator name {@code xray-lambda}.
13+
* A {@link ConfigurablePropagatorProvider} which allows enabling the {@link
14+
* AwsXrayLambdaPropagator} with the propagator name {@code xray-lambda}.
1515
*/
1616
public final class AwsXrayLambdaConfigurablePropagator implements ConfigurablePropagatorProvider {
1717
@Override

aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaPropagator.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
import io.opentelemetry.context.propagation.TextMapGetter;
1111
import io.opentelemetry.context.propagation.TextMapPropagator;
1212
import io.opentelemetry.context.propagation.TextMapSetter;
13-
14-
import javax.annotation.Nullable;
1513
import java.util.Collections;
1614
import java.util.List;
1715
import java.util.Map;
1816
import java.util.Set;
17+
import javax.annotation.Nullable;
1918

2019
/**
2120
* Implementation of the AWS X-Ray Trace Header propagation protocol but with special handling for

aws-xray-propagator/src/test/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaPropagatorTest.java

+25-20
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
package io.opentelemetry.contrib.awsxray.propagator;
77

8+
import static io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator.TRACE_HEADER_KEY;
9+
import static org.assertj.core.api.Assertions.assertThat;
10+
811
import io.opentelemetry.api.trace.Span;
912
import io.opentelemetry.api.trace.SpanContext;
1013
import io.opentelemetry.api.trace.TraceFlags;
@@ -15,6 +18,8 @@
1518
import io.opentelemetry.sdk.trace.ReadableSpan;
1619
import io.opentelemetry.sdk.trace.SdkTracerProvider;
1720
import io.opentelemetry.sdk.trace.data.LinkData;
21+
import java.util.Collections;
22+
import java.util.Map;
1823
import org.junit.jupiter.api.BeforeEach;
1924
import org.junit.jupiter.api.Test;
2025
import org.junit.jupiter.api.extension.ExtendWith;
@@ -23,12 +28,6 @@
2328
import uk.org.webcompere.systemstubs.jupiter.SystemStubsExtension;
2429
import uk.org.webcompere.systemstubs.properties.SystemProperties;
2530

26-
import java.util.Collections;
27-
import java.util.Map;
28-
29-
import static io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator.TRACE_HEADER_KEY;
30-
import static org.assertj.core.api.Assertions.assertThat;
31-
3231
@ExtendWith(SystemStubsExtension.class)
3332
class AwsXrayLambdaPropagatorTest extends AwsXrayPropagatorTest {
3433

@@ -54,7 +53,7 @@ void extract_fromEnvironmentVariable() {
5453
"Root=1-00000001-d188f8fa79d48a391a778fa6;Parent=53995c3f42cd8ad8;Sampled=1;Foo=Bar");
5554

5655
assertThat(
57-
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
56+
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
5857
.isEqualTo(
5958
SpanContext.createFromRemoteParent(
6059
"00000001d188f8fa79d48a391a778fa6",
@@ -70,7 +69,7 @@ void extract_fromSystemProperty() {
7069
"Root=1-00000001-d188f8fa79d48a391a778fa6;Parent=53995c3f42cd8ad8;Sampled=1;Foo=Bar");
7170

7271
assertThat(
73-
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
72+
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
7473
.isEqualTo(
7574
SpanContext.createFromRemoteParent(
7675
"00000001d188f8fa79d48a391a778fa6",
@@ -89,7 +88,7 @@ void extract_systemPropertyBeforeEnvironmentVariable() {
8988
"Root=1-00000002-240000000000000000000002;Parent=1600000000000002;Sampled=1;Foo=Baz");
9089

9190
assertThat(
92-
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
91+
getSpanContext(propagator().extract(Context.current(), Collections.emptyMap(), GETTER)))
9392
.isEqualTo(
9493
SpanContext.createFromRemoteParent(
9594
"00000002240000000000000000000002",
@@ -112,10 +111,15 @@ void addLink_SystemProperty() {
112111
"Root=1-00000003-240000000000000000000003;Parent=1600000000000003;Sampled=1;Foo=Baz");
113112

114113
Context extract = propagator().extract(Context.current(), carrier, GETTER);
115-
ReadableSpan span = (ReadableSpan) tracer.spanBuilder("test")
116-
.setParent(extract)
117-
.addLink(Span.fromContext(propagator().extract(extract, carrier, GETTER)).getSpanContext())
118-
.startSpan();
114+
ReadableSpan span =
115+
(ReadableSpan)
116+
tracer
117+
.spanBuilder("test")
118+
.setParent(extract)
119+
.addLink(
120+
Span.fromContext(propagator().extract(extract, carrier, GETTER))
121+
.getSpanContext())
122+
.startSpan();
119123
assertThat(span.getParentSpanContext())
120124
.isEqualTo(
121125
SpanContext.createFromRemoteParent(
@@ -125,12 +129,13 @@ void addLink_SystemProperty() {
125129
TraceState.getDefault()));
126130

127131
assertThat(span.toSpanData().getLinks())
128-
.isEqualTo(Collections.singletonList(LinkData.create(
129-
SpanContext.createFromRemoteParent(
130-
"00000001240000000000000000000001",
131-
"1600000000000001",
132-
TraceFlags.getSampled(),
133-
TraceState.getDefault()))));
134-
132+
.isEqualTo(
133+
Collections.singletonList(
134+
LinkData.create(
135+
SpanContext.createFromRemoteParent(
136+
"00000001240000000000000000000001",
137+
"1600000000000001",
138+
TraceFlags.getSampled(),
139+
TraceState.getDefault()))));
135140
}
136141
}

0 commit comments

Comments
 (0)