Skip to content

Commit 1519ccd

Browse files
committed
Fix test after merge
1 parent 304540f commit 1519ccd

File tree

1 file changed

+2
-51
lines changed

1 file changed

+2
-51
lines changed

sentry/src/test/java/io/sentry/SentryClientTest.kt

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,55 +1289,6 @@ class SentryClientTest {
12891289
sut.captureException(IllegalStateException())
12901290
verify(fixture.transport, never()).send(any(), anyOrNull())
12911291
}
1292-
@Test
1293-
fun `capturing an error updates session and sends event + session`() {
1294-
val sut = fixture.getSut()
1295-
val scope = givenScopeWithStartedSession()
1296-
1297-
sut.captureEvent(SentryEvent().apply { exceptions = createHandledException() }, scope)
1298-
1299-
thenSessionIsErrored(scope)
1300-
thenEnvelopeIsSentWith(eventCount = 1, sessionCount = 1)
1301-
}
1302-
1303-
@Test
1304-
fun `dropping a captured error from beforeSend has no effect on session and does not send anything`() {
1305-
val sut = fixture.getSut { options ->
1306-
options.beforeSend = SentryOptions.BeforeSendCallback { _, _ -> null }
1307-
}
1308-
val scope = givenScopeWithStartedSession()
1309-
1310-
sut.captureEvent(SentryEvent().apply { exceptions = createHandledException() }, scope)
1311-
1312-
thenSessionIsStillOK(scope)
1313-
thenNothingIsSent()
1314-
}
1315-
1316-
@Test
1317-
fun `dropping a captured error from eventProcessor has no effect on session and does not send anything`() {
1318-
val sut = fixture.getSut { options ->
1319-
options.addEventProcessor(DropEverythingEventProcessor())
1320-
}
1321-
val scope = givenScopeWithStartedSession()
1322-
1323-
sut.captureEvent(SentryEvent().apply { exceptions = createHandledException() }, scope)
1324-
1325-
thenSessionIsStillOK(scope)
1326-
thenNothingIsSent()
1327-
}
1328-
1329-
@Test
1330-
fun `dropping a captured error via sampling updates the session and only sends the session for a new session`() {
1331-
val sut = fixture.getSut { options ->
1332-
options.sampleRate = 0.000000000001
1333-
}
1334-
val scope = givenScopeWithStartedSession()
1335-
1336-
sut.captureEvent(SentryEvent().apply { exceptions = createHandledException() }, scope)
1337-
1338-
thenSessionIsErrored(scope)
1339-
thenEnvelopeIsSentWith(eventCount = 0, sessionCount = 1)
1340-
}
13411292

13421293
@Test
13431294
fun `screenshot is added to the envelope from the hint`() {
@@ -2103,13 +2054,13 @@ class SentryClientTest {
21032054

21042055
class DropEverythingEventProcessor : EventProcessor {
21052056

2106-
override fun process(event: SentryEvent, hint: Any?): SentryEvent? {
2057+
override fun process(event: SentryEvent, hint: Hint): SentryEvent? {
21072058
return null
21082059
}
21092060

21102061
override fun process(
21112062
transaction: SentryTransaction,
2112-
hint: Any?
2063+
hint: Hint
21132064
): SentryTransaction? {
21142065
return null
21152066
}

0 commit comments

Comments
 (0)