@@ -23,6 +23,7 @@ import io.sentry.rrweb.RRWebMetaEvent
2323import io.sentry.rrweb.RRWebVideoEvent
2424import io.sentry.transport.CurrentDateProvider
2525import io.sentry.transport.ICurrentDateProvider
26+ import io.sentry.transport.RateLimiter
2627import java.time.Duration
2728import java.util.concurrent.Executors
2829import java.util.concurrent.TimeUnit
@@ -41,6 +42,7 @@ import org.mockito.kotlin.any
4142import org.mockito.kotlin.anyOrNull
4243import org.mockito.kotlin.check
4344import org.mockito.kotlin.doAnswer
45+ import org.mockito.kotlin.doReturn
4446import org.mockito.kotlin.mock
4547import org.mockito.kotlin.verify
4648import org.mockito.kotlin.whenever
@@ -61,11 +63,17 @@ class ReplaySmokeTest {
6163 internal class Fixture {
6264 val options = SentryOptions ()
6365 val scope = Scope (options)
66+ val rateLimiter =
67+ mock<RateLimiter > {
68+ on { isActiveForCategory(any()) }.thenReturn(false )
69+ }
6470 val scopes =
6571 mock<IScopes > {
6672 doAnswer { (it.arguments[0 ] as ScopeCallback ).run (scope) }
6773 .whenever(it)
6874 .configureScope(any())
75+
76+ on { rateLimiter }.doReturn(rateLimiter)
6977 }
7078
7179 private class ImmediateHandler :
@@ -91,7 +99,10 @@ class ReplaySmokeTest {
9199 mainLooperHandler =
92100 mock {
93101 whenever(mock.handler).thenReturn(ImmediateHandler ())
94- whenever(mock.post(any())).then { (it.arguments[0 ] as Runnable ).run () }
102+ whenever(mock.post(any())).then {
103+ (it.arguments[0 ] as Runnable ).run ()
104+ true
105+ }
95106 whenever(mock.postDelayed(any(), anyLong())).then {
96107 // have to use another thread here otherwise it will block the test thread
97108 recordingThread.schedule(
0 commit comments