34
34
import io .opentelemetry .sdk .trace .data .SpanData ;
35
35
import io .opentelemetry .sdk .trace .export .SpanExporter ;
36
36
import io .opentelemetry .semconv .HttpAttributes ;
37
+ import io .opentelemetry .semconv .UrlAttributes ;
37
38
import io .opentelemetry .semconv .incubating .CodeIncubatingAttributes ;
38
39
import io .opentelemetry .semconv .incubating .DbIncubatingAttributes ;
39
40
import io .opentelemetry .spring .smoketest .OtelSpringStarterSmokeTestApplication ;
@@ -214,7 +215,7 @@ void propertyConversion() {
214
215
}
215
216
216
217
@ Test
217
- void shouldSendTelemetry () throws InterruptedException {
218
+ void shouldSendTelemetry () {
218
219
testRestTemplate .getForObject (OtelSpringStarterSmokeTestController .PING , String .class );
219
220
220
221
// Span
@@ -226,9 +227,7 @@ void shouldSendTelemetry() throws InterruptedException {
226
227
clientSpan
227
228
.hasKind (SpanKind .CLIENT )
228
229
.hasAttributesSatisfying (
229
- a ->
230
- assertThat (a .get (HttpAttributes .URL_FULL ))
231
- .endsWith ("/ping" )),
230
+ a -> assertThat (a .get (UrlAttributes .URL_FULL )).endsWith ("/ping" )),
232
231
serverSpan ->
233
232
serverSpan
234
233
.hasKind (SpanKind .SERVER )
@@ -255,7 +254,7 @@ void shouldSendTelemetry() throws InterruptedException {
255
254
}
256
255
257
256
@ Test
258
- void restTemplateClient () throws InterruptedException {
257
+ void restTemplateClient () {
259
258
testRestTemplate .getForObject (OtelSpringStarterSmokeTestController .REST_TEMPLATE , String .class );
260
259
261
260
TracesAssert .assertThat (expectSpans (4 ))
@@ -267,7 +266,7 @@ void restTemplateClient() throws InterruptedException {
267
266
.hasKind (SpanKind .CLIENT )
268
267
.hasAttributesSatisfying (
269
268
a ->
270
- assertThat (a .get (SemanticAttributes .URL_FULL ))
269
+ assertThat (a .get (UrlAttributes .URL_FULL ))
271
270
.endsWith ("/rest-template" )),
272
271
serverSpan ->
273
272
serverSpan
@@ -277,9 +276,7 @@ void restTemplateClient() throws InterruptedException {
277
276
nestedClientSpan
278
277
.hasKind (SpanKind .CLIENT )
279
278
.hasAttributesSatisfying (
280
- a ->
281
- assertThat (a .get (SemanticAttributes .URL_FULL ))
282
- .endsWith ("/ping" )),
279
+ a -> assertThat (a .get (UrlAttributes .URL_FULL )).endsWith ("/ping" )),
283
280
nestedServerSpan ->
284
281
nestedServerSpan
285
282
.hasKind (SpanKind .SERVER )
0 commit comments