Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strangesource committed Sep 4, 2024
1 parent 359ae9b commit 56bda87
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.bitmovin.analytics.conviva.helper.unmockLogging
import com.bitmovin.analytics.conviva.ssai.DefaultSsaiApi
import com.bitmovin.player.api.Player
import com.bitmovin.player.api.deficiency.PlayerErrorCode
import com.bitmovin.player.api.deficiency.PlayerWarningCode
import com.bitmovin.player.api.deficiency.SourceWarningCode
import com.bitmovin.player.api.event.PlayerEvent
import com.bitmovin.player.api.event.SourceEvent
import com.bitmovin.player.api.media.Quality
Expand Down Expand Up @@ -168,6 +170,22 @@ class ConvivaAnalyticsIntegrationTest {
verify { adAnalytics.reportAdMetric(ConvivaSdkConstants.PLAYBACK.RENDERED_FRAMERATE, 10) }
}

@Test
fun `does not report a playback error when receiving a player warning event without active conviva session`() {
player.listeners[PlayerEvent.Warning::class]?.forEach { onEvent ->
onEvent(PlayerEvent.Warning(PlayerWarningCode.General, "warning"))
}
verify(exactly = 0) { videoAnalytics.reportPlaybackError(any(), any()) }
}

@Test
fun `does not report a playback error when receiving a source warning event without active conviva session`() {
player.listeners[SourceEvent.Warning::class]?.forEach { onEvent ->
onEvent(SourceEvent.Warning(SourceWarningCode.General, "warning"))
}
verify(exactly = 0) { videoAnalytics.reportPlaybackError(any(), any()) }
}

companion object {
@JvmStatic
@BeforeClass
Expand Down

0 comments on commit 56bda87

Please sign in to comment.