@@ -434,7 +434,11 @@ class SentryEnvelopeItemTest {
434434 @Test
435435 fun `fromProfilingTrace with unreadable file throws` () {
436436 val file = File (fixture.pathname)
437- val profilingTraceData = mock<ProfilingTraceData > { whenever(it.traceFile).thenReturn(file) }
437+ val profilingTraceData =
438+ mock<ProfilingTraceData > {
439+ whenever(it.traceFile).thenReturn(file)
440+ whenever(it.platform).thenReturn(" android" )
441+ }
438442 file.writeBytes(fixture.bytes)
439443 file.setReadable(false )
440444 assertFailsWith<IOException >(
@@ -492,7 +496,11 @@ class SentryEnvelopeItemTest {
492496 @Test
493497 fun `fromProfileChunk saves file as Base64` () {
494498 val file = File (fixture.pathname)
495- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
499+ val profileChunk =
500+ mock<ProfileChunk > {
501+ whenever(it.traceFile).thenReturn(file)
502+ whenever(it.platform).thenReturn(" android" )
503+ }
496504
497505 file.writeBytes(fixture.bytes)
498506 val chunk = SentryEnvelopeItem .fromProfileChunk(profileChunk, mock()).data
@@ -503,7 +511,11 @@ class SentryEnvelopeItemTest {
503511 @Test
504512 fun `fromProfileChunk deletes file only after reading data` () {
505513 val file = File (fixture.pathname)
506- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
514+ val profileChunk =
515+ mock<ProfileChunk > {
516+ whenever(it.traceFile).thenReturn(file)
517+ whenever(it.platform).thenReturn(" android" )
518+ }
507519
508520 file.writeBytes(fixture.bytes)
509521 assert (file.exists())
@@ -516,7 +528,11 @@ class SentryEnvelopeItemTest {
516528 @Test
517529 fun `fromProfileChunk with invalid file throws` () {
518530 val file = File (fixture.pathname)
519- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
531+ val profileChunk =
532+ mock<ProfileChunk > {
533+ whenever(it.traceFile).thenReturn(file)
534+ whenever(it.platform).thenReturn(" android" )
535+ }
520536
521537 assertFailsWith<SentryEnvelopeException >(
522538 " Dropping profiling trace data, because the file ${file.path} doesn't exists"
@@ -528,7 +544,11 @@ class SentryEnvelopeItemTest {
528544 @Test
529545 fun `fromProfileChunk with unreadable file throws` () {
530546 val file = File (fixture.pathname)
531- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
547+ val profileChunk =
548+ mock<ProfileChunk > {
549+ whenever(it.traceFile).thenReturn(file)
550+ whenever(it.platform).thenReturn(" android" )
551+ }
532552 file.writeBytes(fixture.bytes)
533553 file.setReadable(false )
534554 assertFailsWith<IOException >(
@@ -542,7 +562,11 @@ class SentryEnvelopeItemTest {
542562 fun `fromProfileChunk with empty file throws` () {
543563 val file = File (fixture.pathname)
544564 file.writeBytes(ByteArray (0 ))
545- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
565+ val profileChunk =
566+ mock<ProfileChunk > {
567+ whenever(it.traceFile).thenReturn(file)
568+ whenever(it.platform).thenReturn(" android" )
569+ }
546570
547571 val chunk = SentryEnvelopeItem .fromProfileChunk(profileChunk, mock())
548572 assertFailsWith<SentryEnvelopeException >(" Profiling trace file is empty" ) { chunk.data }
@@ -553,7 +577,11 @@ class SentryEnvelopeItemTest {
553577 val file = File (fixture.pathname)
554578 val maxSize = 50 * 1024 * 1024 // 50MB
555579 file.writeBytes(ByteArray ((maxSize + 1 )) { 0 })
556- val profileChunk = mock<ProfileChunk > { whenever(it.traceFile).thenReturn(file) }
580+ val profileChunk =
581+ mock<ProfileChunk > {
582+ whenever(it.traceFile).thenReturn(file)
583+ whenever(it.platform).thenReturn(" android" )
584+ }
557585
558586 val exception =
559587 assertFailsWith<IOException > {
0 commit comments