From fd290d389a23ffad4760af8be92a4d8af3109325 Mon Sep 17 00:00:00 2001 From: bidetofevil Date: Thu, 19 Dec 2024 10:05:30 -0800 Subject: [PATCH] Only assert the crash enveloper --- .../features/ResurrectionFeatureTest.kt | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/testcases/features/ResurrectionFeatureTest.kt b/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/testcases/features/ResurrectionFeatureTest.kt index fb8cd6a530..49e93c8e3c 100644 --- a/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/testcases/features/ResurrectionFeatureTest.kt +++ b/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/testcases/features/ResurrectionFeatureTest.kt @@ -16,12 +16,10 @@ import io.embrace.android.embracesdk.internal.config.remote.RemoteConfig import io.embrace.android.embracesdk.internal.delivery.PayloadType import io.embrace.android.embracesdk.internal.delivery.StoredTelemetryMetadata import io.embrace.android.embracesdk.internal.delivery.SupportedEnvelopeType -import io.embrace.android.embracesdk.internal.spans.findAttributeValue import io.embrace.android.embracesdk.testframework.IntegrationTestRule import io.embrace.android.embracesdk.testframework.actions.EmbraceSetupInterface import io.embrace.android.embracesdk.testframework.actions.createStoredNativeCrashData import io.embrace.android.embracesdk.testframework.assertions.getLastLog -import io.opentelemetry.semconv.ExceptionAttributes import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertNotNull @@ -138,31 +136,13 @@ internal class ResurrectionFeatureTest { }, assertAction = { val session = getSingleSessionEnvelope() - val envelopes = getLogEnvelopes(2).sortedBy { it.data.logs?.size } - with(envelopes.first()) { + val crashEnvelope = getSingleLogEnvelope() + with(crashEnvelope) { assertEquals(session.resource, resource) assertEquals(session.metadata, metadata) val crash = getLastLog() assertNativeCrashSent(crash, crashData, testRule.setup.symbols) } - - with(envelopes.last()) { - val errors = checkNotNull(data.logs) - assertEquals(2, errors.size) - with(errors.first()) { - assertEquals( - "Cached native crash envelope data not found", - attributes?.findAttributeValue(ExceptionAttributes.EXCEPTION_MESSAGE.key) - ) - } - - with(errors.last()) { - assertEquals( - "java.io.FileNotFoundException", - attributes?.findAttributeValue(ExceptionAttributes.EXCEPTION_TYPE.key) - ) - } - } } ) }