Skip to content

Commit ddbe532

Browse files
committed
Fix tests
1 parent 034445f commit ddbe532

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

sentry-android-core/src/test/java/io/sentry/android/core/ApplicationExitInfoEventProcessorTest.kt

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,44 @@ class ApplicationExitInfoEventProcessorTest {
603603
fun `sets default fingerprint to distinguish between background and foreground ANRs`() {
604604
val backgroundHint =
605605
HintUtils.createWithTypeCheckHint(AbnormalExitHint(mechanism = "anr_background"))
606-
val processedBackground = processEvent(backgroundHint, populateScopeCache = false)
606+
val processedBackground =
607+
processEvent(backgroundHint, populateScopeCache = false) {
608+
exceptions =
609+
listOf(
610+
SentryException().apply {
611+
this.stacktrace =
612+
SentryStackTrace(
613+
listOf(
614+
SentryStackFrame().apply {
615+
module = "io.sentry.samples.MainActivity"
616+
function = "run"
617+
}
618+
)
619+
)
620+
}
621+
)
622+
}
607623
assertEquals(listOf("{{ default }}", "background-anr"), processedBackground.fingerprints)
608624

609625
val foregroundHint =
610626
HintUtils.createWithTypeCheckHint(AbnormalExitHint(mechanism = "anr_foreground"))
611-
val processedForeground = processEvent(foregroundHint, populateScopeCache = false)
627+
val processedForeground =
628+
processEvent(foregroundHint, populateScopeCache = false) {
629+
exceptions =
630+
listOf(
631+
SentryException().apply {
632+
this.stacktrace =
633+
SentryStackTrace(
634+
listOf(
635+
SentryStackFrame().apply {
636+
module = "io.sentry.samples.MainActivity"
637+
function = "run"
638+
}
639+
)
640+
)
641+
}
642+
)
643+
}
612644
assertEquals(listOf("{{ default }}", "foreground-anr"), processedForeground.fingerprints)
613645
}
614646

0 commit comments

Comments
 (0)