diff --git a/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/IncubatingNotFoundApiTests.java b/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/IncubatingNotFoundApiTests.java index ba2ba02a2c3..0a840a68d3b 100644 --- a/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/IncubatingNotFoundApiTests.java +++ b/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/IncubatingNotFoundApiTests.java @@ -7,20 +7,24 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.Logger; import io.opentelemetry.api.logs.LoggerProvider; -import io.opentelemetry.api.metrics.LongCounterBuilder; import io.opentelemetry.api.metrics.MeterProvider; -import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.api.trace.TracerProvider; import org.junit.jupiter.api.Test; class IncubatingNotFoundApiTests { @Test void incubatingApiIsNotFoundViaReflection() { - assertThat(LoggerProvider.noop().get("test")).isInstanceOf(Logger.class); - assertThat(TracerProvider.noop().get("test")).isInstanceOf(Tracer.class); - assertThat(MeterProvider.noop().get("test").counterBuilder("test")) - .isInstanceOf(LongCounterBuilder.class); + // The graal module deliberately excludes :api:incubator, so the noop instances must come from + // the stable api packages, not io.opentelemetry.api.incubator.*. An isInstanceOf check against + // the stable types cannot detect a regression here because the incubator Extended* types + // subtype the stable types; assert on the runtime class package instead, since the Extended* + // types are not on this module's classpath to reference directly. + assertThat(LoggerProvider.noop().get("test").getClass().getName()) + .doesNotStartWith("io.opentelemetry.api.incubator."); + assertThat(TracerProvider.noop().get("test").getClass().getName()) + .doesNotStartWith("io.opentelemetry.api.incubator."); + assertThat(MeterProvider.noop().get("test").counterBuilder("test").getClass().getName()) + .doesNotStartWith("io.opentelemetry.api.incubator."); } }