Skip to content

Commit 0534721

Browse files
committed
added a test
1 parent 1e04539 commit 0534721

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/semconv/http/HttpSpanNameExtractorTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,11 @@ void nothing() {
4646
assertThat(HttpSpanNameExtractor.create(clientGetter).extract(Collections.emptyMap()))
4747
.isEqualTo("HTTP");
4848
}
49+
50+
@Test
51+
void templateAndMethod() {
52+
when(clientGetter.getUrlTemplate(anyMap())).thenReturn("/cats/{id}");
53+
when(clientGetter.getHttpRequestMethod(anyMap())).thenReturn("GET");
54+
assertThat(HttpSpanNameExtractor.create(clientGetter).extract(Collections.emptyMap())).isEqualTo("GET /cats/{id}");
55+
}
4956
}

0 commit comments

Comments
 (0)