diff --git a/consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentReservoirSamplingSpanProcessorTest.java b/consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentReservoirSamplingSpanProcessorTest.java index 2862c8ab..b2acf46e 100644 --- a/consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentReservoirSamplingSpanProcessorTest.java +++ b/consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentReservoirSamplingSpanProcessorTest.java @@ -243,9 +243,11 @@ class ConsistentReservoirSamplingSpanProcessorTest { @Test void ignoresNullSpans() { + SpanExporter mockSpanExporter = mock(SpanExporter.class); + when(mockSpanExporter.shutdown()).thenReturn(CompletableResultCode.ofSuccess()); SpanProcessor processor = ConsistentReservoirSamplingSpanProcessor.create( - mock(SpanExporter.class), RESERVOIR_SIZE, EXPORT_PERIOD_100_MILLIS_AS_NANOS); + mockSpanExporter, RESERVOIR_SIZE, EXPORT_PERIOD_100_MILLIS_AS_NANOS); assertThatCode( () -> { processor.onStart(null, null);