Skip to content

Commit 53283e8

Browse files
committed
add check for transaction type in test
1 parent 6546ee0 commit 53283e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ndk/lib/src/androidTest/java/io/sentry/ndk/SentryNdkTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
import static org.junit.Assert.assertEquals;
44
import static org.junit.Assert.assertNotNull;
5+
import static org.junit.Assert.assertTrue;
56

67
import androidx.test.ext.junit.runners.AndroidJUnit4;
78
import io.sentry.ndk.sample.NdkSample;
89
import java.io.File;
910
import java.io.IOException;
11+
import java.nio.charset.StandardCharsets;
12+
import java.nio.file.Files;
1013
import org.junit.Test;
1114
import org.junit.rules.TemporaryFolder;
1215
import org.junit.runner.RunWith;
@@ -92,7 +95,9 @@ public void transactionSampled() throws IOException {
9295
File[] files = outboxPath.listFiles();
9396
assertNotNull(files);
9497
assertEquals(1, files.length);
95-
// TODO check file contents and if it contains "type":"transaction"
98+
File firstFile = files[0];
99+
String content = new String(Files.readAllBytes(firstFile.toPath()), StandardCharsets.UTF_8);
100+
assertTrue(content.contains("\"type\":\"transaction\""));
96101
}
97102

98103
@Test

0 commit comments

Comments
 (0)