From 123080e67bf955102d9c3788dd579f97e62b7910 Mon Sep 17 00:00:00 2001 From: Jorge Antonio Diaz-Benito Soriano Date: Thu, 23 May 2024 16:09:11 +0200 Subject: [PATCH] Ensure that we do not miss PlayLog calls to eventSender after each test --- .../com/tidal/sdk/player/playlog/PlayLogTest.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/player/src/androidTest/kotlin/com/tidal/sdk/player/playlog/PlayLogTest.kt b/player/src/androidTest/kotlin/com/tidal/sdk/player/playlog/PlayLogTest.kt index c610629e..90c2b897 100644 --- a/player/src/androidTest/kotlin/com/tidal/sdk/player/playlog/PlayLogTest.kt +++ b/player/src/androidTest/kotlin/com/tidal/sdk/player/playlog/PlayLogTest.kt @@ -50,7 +50,10 @@ import org.junit.Before import org.junit.BeforeClass import org.junit.Rule import org.junit.Test +import org.mockito.Mockito.atMost import org.mockito.Mockito.mock +import org.mockito.Mockito.verifyNoMoreInteractions +import org.mockito.kotlin.anyOrNull import org.mockito.kotlin.argThat import org.mockito.kotlin.eq import org.mockito.kotlin.verify @@ -129,6 +132,14 @@ class PlayLogTest { val job = launch { player.playbackEngine.events.first { it is Event.Release } } player.release() job.join() + verify(eventSender, atMost(Int.MAX_VALUE)) + .sendEvent( + argThat { !contentEquals("playback_session") }, + anyOrNull(), + anyOrNull(), + anyOrNull() + ) + verifyNoMoreInteractions(eventSender) } @RepeatableFlakyTest // Playback may take longer in practice than it should in theory