File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
sentry-android-replay/src/test/java/io/sentry/android/replay Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -750,9 +750,10 @@ class ReplayIntegrationTest {
750750 Random (),
751751 // run tasks synchronously in tests
752752 mock {
753- doAnswer { (it.arguments[0 ] as Runnable ).run () }
754- .whenever(mock)
755- .submit(any<Runnable >())
753+ whenever(mock.submit(any<Runnable >())).doAnswer {
754+ (it.arguments[0 ] as Runnable ).run ()
755+ null
756+ }
756757 },
757758 ) { _ ->
758759 fixture.replayCache
@@ -979,7 +980,10 @@ class ReplayIntegrationTest {
979980 CurrentDateProvider .getInstance(),
980981 executor =
981982 mock {
982- doAnswer { (it.arguments[0 ] as Runnable ).run () }.whenever(mock).submit(any<Runnable >())
983+ whenever(mock.submit(any<Runnable >())).doAnswer {
984+ (it.arguments[0 ] as Runnable ).run ()
985+ null
986+ }
983987 },
984988 )
985989}
Original file line number Diff line number Diff line change @@ -106,12 +106,10 @@ class BufferCaptureStrategyTest {
106106 dateProvider,
107107 Random (),
108108 mock {
109- doAnswer { invocation ->
110- (invocation.arguments[0 ] as Runnable ).run ()
111- null
112- }
113- .whenever(it)
114- .submit(any<Runnable >())
109+ whenever(it.submit(any<Runnable >())).doAnswer { invocation ->
110+ (invocation.arguments[0 ] as Runnable ).run ()
111+ null
112+ }
115113 },
116114 ) { _ ->
117115 replayCache
@@ -356,6 +354,7 @@ class BufferCaptureStrategyTest {
356354 strategy.onConfigurationChanged(fixture.recorderConfig)
357355
358356 val oldTimestamp = strategy.segmentTimestamp
357+ whenever(fixture.replayCache.firstFrameTimestamp()).thenReturn(oldTimestamp!! .time)
359358
360359 strategy.captureReplay(false ) { newTimestamp ->
361360 assertEquals(oldTimestamp!! .time + VIDEO_DURATION , newTimestamp.time)
You can’t perform that action at this time.
0 commit comments