Skip to content

Commit

Permalink
Ensure that we do not miss PlayLog calls to eventSender after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed May 28, 2024
1 parent 3b6560a commit 123080e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 123080e

Please sign in to comment.