From f137f5ab83d091795e8fef9255b74e1ec0824256 Mon Sep 17 00:00:00 2001 From: Jason Plumb Date: Fri, 8 Dec 2023 09:44:46 -0800 Subject: [PATCH] fix tests --- .../opentelemetry/android/OpenTelemetryRumBuilderTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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();