diff --git a/instrumentation/src/test/java/io/opentelemetry/android/OpenTelemetryRumBuilderTest.java b/instrumentation/src/test/java/io/opentelemetry/android/OpenTelemetryRumBuilderTest.java index 7324b5927..033e1726c 100644 --- a/instrumentation/src/test/java/io/opentelemetry/android/OpenTelemetryRumBuilderTest.java +++ b/instrumentation/src/test/java/io/opentelemetry/android/OpenTelemetryRumBuilderTest.java @@ -34,6 +34,7 @@ import java.time.Duration; import java.util.List; import java.util.function.Function; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -49,11 +50,17 @@ class OpenTelemetryRumBuilderTest { final InMemorySpanExporter spanExporter = InMemorySpanExporter.create(); @Mock Application application; + @Mock android.content.Context applicationContext; @Mock Activity activity; @Mock ApplicationStateListener listener; @Captor ArgumentCaptor activityCallbacksCaptor; + @BeforeEach + void setup() { + when(application.getApplicationContext()).thenReturn(applicationContext); + } + @Test void shouldRegisterApplicationStateWatcher() { makeBuilder().build();