Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
Loading