content: /*
   * Copyright The OpenTelemetry Authors
   * SPDX-License-Identifier: Apache-2.0
   */
  
  package io.opentelemetry.javaagent.instrumentation.methods;
  
  import static io.opentelemetry.instrumentation.testing.junit.code.SemconvCodeStabilityUtil.codeFunctionAssertions;
  import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
  
  import io.opentelemetry.api.trace.SpanKind;
  import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
  import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
  import java.util.concurrent.Callable;
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.extension.RegisterExtension;
  
  @SuppressWarnings("deprecation") // using deprecated semconv
  class MethodTest {
  
    @RegisterExtension
    static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
  
    @SuppressWarnings("deprecation") // using deprecated semconv
    @Test
    void methodTraced() {
      assertThat(new ConfigTracedCallable().call()).isEqualTo("Hello!");
      testing.waitAndAssertTraces(
          trace ->
              trace.hasSpansSatisfyingExactly(
                  span ->
                      span.hasName("ConfigTracedCallable.call")
                          .hasKind(SpanKind.SERVER)
                          .hasAttributesSatisfyingExactly(
                              codeFunctionAssertions(ConfigTracedCallable.class, "call"))));
    }
  
    static class ConfigTracedCallable implements Callable<String> {
  
      @Override
      public String call() {
        return "Hello!";
      }
    }
  }
  