Skip to content

Commit d63db29

Browse files
committed
code review changes
1 parent f9b17d8 commit d63db29

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

sentry/src/main/java/io/sentry/SentryOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

sentry/src/test/java/io/sentry/util/InitUtilTest.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@ package io.sentry.util
22

33
import io.sentry.InitPriority
44
import io.sentry.SentryOptions
5+
import kotlin.test.BeforeTest
56
import kotlin.test.Test
67
import kotlin.test.assertFalse
78
import kotlin.test.assertTrue
89

910
class 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`() {

0 commit comments

Comments
 (0)