Skip to content

Commit 2b4287a

Browse files
antonisclaude
andcommitted
fix(test): Use JUnit assertNotNull instead of Kotlin assert
Kotlin's assert() compiles to a JVM assertion that is a no-op without the -ea flag. Use JUnit's assertNotNull for reliable test assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0bd1e79 commit 2b4287a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/core/RNSentryAndroidTester/app/src/test/java/io/sentry/rnsentryandroidtester/RNSentryReplayBreadcrumbConverterTest.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import io.sentry.SentryLevel
55
import io.sentry.react.RNSentryReplayBreadcrumbConverter
66
import io.sentry.rrweb.RRWebBreadcrumbEvent
77
import org.junit.Assert.assertEquals
8+
import org.junit.Assert.assertNotNull
89
import org.junit.Test
910
import org.junit.runner.RunWith
1011
import org.junit.runners.JUnit4
@@ -81,7 +82,7 @@ class RNSentryReplayBreadcrumbConverterTest {
8182
testBreadcrumb.setData("orientation", "portrait")
8283
val actual = converter.convert(testBreadcrumb)
8384

84-
assert(actual != null) { "device.orientation breadcrumbs should pass through to the default converter" }
85+
assertNotNull("device.orientation breadcrumbs should pass through to the default converter", actual)
8586
}
8687

8788
@Test
@@ -93,7 +94,7 @@ class RNSentryReplayBreadcrumbConverterTest {
9394
testBreadcrumb.setData("connectivity", "wifi")
9495
val actual = converter.convert(testBreadcrumb)
9596

96-
assert(actual != null) { "device.connectivity breadcrumbs should pass through to the default converter" }
97+
assertNotNull("device.connectivity breadcrumbs should pass through to the default converter", actual)
9798
}
9899

99100
@Test
@@ -105,7 +106,7 @@ class RNSentryReplayBreadcrumbConverterTest {
105106
testBreadcrumb.setData("action", "LOW_MEMORY")
106107
val actual = converter.convert(testBreadcrumb)
107108

108-
assert(actual != null) { "device.event breadcrumbs should pass through to the default converter" }
109+
assertNotNull("device.event breadcrumbs should pass through to the default converter", actual)
109110
}
110111

111112
@Test

0 commit comments

Comments
 (0)