File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -490,6 +490,7 @@ public class SentryOptions {
490490 private @ NotNull ScopeType defaultScopeType = ScopeType .ISOLATION ;
491491
492492 private @ NotNull InitPriority initPriority = InitPriority .MEDIUM ;
493+
493494 private boolean forceInit = false ;
494495
495496 /**
@@ -2592,7 +2593,6 @@ public SentryOptions() {
25922593 */
25932594 private SentryOptions (final boolean empty ) {
25942595 if (!empty ) {
2595- setInitPriority (InitPriority .LOWEST );
25962596 setSpanFactory (new DefaultSpanFactory ());
25972597 // SentryExecutorService should be initialized before any
25982598 // SendCachedEventFireAndForgetIntegration
Original file line number Diff line number Diff line change @@ -728,4 +728,9 @@ class SentryOptionsTest {
728728 assertEquals(30 , options.cron?.defaultFailureIssueThreshold)
729729 assertEquals(40 , options.cron?.defaultRecoveryThreshold)
730730 }
731+
732+ @Test
733+ fun `when options is initialized, InitPriority is set to MEDIUM by default` () {
734+ assertEquals(SentryOptions ().initPriority, InitPriority .MEDIUM )
735+ }
731736}
Original file line number Diff line number Diff line change @@ -2,15 +2,23 @@ package io.sentry.util
22
33import io.sentry.InitPriority
44import io.sentry.SentryOptions
5+ import kotlin.test.BeforeTest
56import kotlin.test.Test
67import kotlin.test.assertFalse
78import kotlin.test.assertTrue
89
910class InitUtilTest {
1011
11- var previousOptions: SentryOptions ? = null
12- var newOptions: SentryOptions ? = null
13- var clientEnabled: Boolean = true
12+ private var previousOptions: SentryOptions ? = null
13+ private var newOptions: SentryOptions ? = null
14+ private var clientEnabled: Boolean = true
15+
16+ @BeforeTest
17+ fun setup () {
18+ previousOptions = null
19+ newOptions = null
20+ clientEnabled = true
21+ }
1422
1523 @Test
1624 fun `first init on empty options goes through` () {
You can’t perform that action at this time.
0 commit comments