88import static io .opentelemetry .instrumentation .testing .junit .http .ServerEndpoint .SUCCESS ;
99import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .equalTo ;
1010import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .satisfies ;
11- import static io .opentelemetry .semconv .incubating .CodeIncubatingAttributes .CODE_FUNCTION ;
12- import static io .opentelemetry .semconv .incubating .CodeIncubatingAttributes .CODE_NAMESPACE ;
11+ import static io .opentelemetry .semconv .incubating .CodeIncubatingAttributes .CODE_FUNCTION_NAME ;
1312import static java .util .concurrent .TimeUnit .SECONDS ;
1413import static org .assertj .core .api .Assertions .assertThat ;
1514import static org .junit .jupiter .api .Assumptions .assumeTrue ;
3332import org .junit .jupiter .params .ParameterizedTest ;
3433import org .junit .jupiter .params .provider .EnumSource ;
3534
36- @ SuppressWarnings ("deprecation" ) // using deprecated semconv
3735public abstract class AbstractJaxRsHttpServerTest <SERVER > extends AbstractHttpServerTest <SERVER > {
3836
3937 protected abstract void awaitBarrier (int amount , TimeUnit timeUnit ) throws Exception ;
@@ -214,8 +212,8 @@ void shouldHandleAsyncResponse(AsyncResponseTestKind testKind) throws Exception
214212 .hasParent (trace .getSpan (0 ))
215213 .hasAttributesSatisfyingExactly (
216214 satisfies (
217- CODE_NAMESPACE , name -> name . endsWith ( "JaxRsTestResource" )) ,
218- equalTo ( CODE_FUNCTION , " asyncOp" ),
215+ CODE_FUNCTION_NAME ,
216+ name -> name . endsWith ( "JaxRsTestResource. asyncOp") ),
219217 equalTo (
220218 AttributeKey .booleanKey ("jaxrs.canceled" ),
221219 testKind == AsyncResponseTestKind .CANCELED ? true : null ));
@@ -302,9 +300,8 @@ void shouldHandleCompletionStage(CompletionStageTestKind testKind) throws Except
302300 .hasParent (trace .getSpan (0 ))
303301 .hasAttributesSatisfyingExactly (
304302 equalTo (
305- CODE_NAMESPACE ,
306- "io.opentelemetry.instrumentation.jaxrs.v2_0.test.JaxRsTestResource" ),
307- equalTo (CODE_FUNCTION , "jaxRs21Async" ));
303+ CODE_FUNCTION_NAME ,
304+ "io.opentelemetry.instrumentation.jaxrs.v2_0.test.JaxRsTestResource.jaxRs21Async" ));
308305 if (testKind == CompletionStageTestKind .FAILING ) {
309306 span .hasStatus (StatusData .error ())
310307 .hasException (new IllegalStateException ("failure" ));
@@ -319,7 +316,7 @@ protected SpanDataAssert assertHandlerSpan(
319316 return span .hasName ("JaxRsTestResource." + methodName )
320317 .hasKind (SpanKind .INTERNAL )
321318 .hasAttributesSatisfyingExactly (
322- satisfies (CODE_NAMESPACE , name -> name . endsWith ( "JaxRsTestResource" )),
323- equalTo ( CODE_FUNCTION , methodName ));
319+ satisfies (
320+ CODE_FUNCTION_NAME , name -> name . endsWith ( "JaxRsTestResource." + methodName ) ));
324321 }
325322}
0 commit comments