diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporter.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporter.kt index 4b9a96f5a7..80ecaf2ae5 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporter.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporter.kt @@ -237,7 +237,7 @@ internal class DatadogLateCrashReporter( architecture = deviceInfo.architecture ), dd = ErrorEvent.Dd( - session = ErrorEvent.DdSession(plan = ErrorEvent.Plan.PLAN_1), + session = ErrorEvent.DdSession(), configuration = ErrorEvent.Configuration(sessionSampleRate = viewEvent.sampleRate) ), context = ErrorEvent.Context(additionalProperties = additionalProperties), diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScope.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScope.kt index 8943dc27fb..c851553687 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScope.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScope.kt @@ -292,7 +292,6 @@ internal class RumActionScope( context = ActionEvent.Context(additionalProperties = eventAttributes), dd = ActionEvent.Dd( session = ActionEvent.DdSession( - plan = ActionEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toActionSessionPrecondition() ), configuration = ActionEvent.Configuration(sessionSampleRate = sampleRate) diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt index 0932f99cc6..8396e3fa1b 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt @@ -281,7 +281,6 @@ internal class RumResourceScope( spanId = spanId, rulePsr = rulePsr, session = ResourceEvent.DdSession( - plan = ResourceEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toResourceSessionPrecondition() ), configuration = ResourceEvent.Configuration(sessionSampleRate = sampleRate) @@ -426,7 +425,6 @@ internal class RumResourceScope( context = ErrorEvent.Context(additionalProperties = eventAttributes), dd = ErrorEvent.Dd( session = ErrorEvent.DdSession( - plan = ErrorEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toErrorSessionPrecondition() ), configuration = ErrorEvent.Configuration(sessionSampleRate = sampleRate) diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt index e0cc6cf23f..8c115ef326 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt @@ -483,7 +483,6 @@ internal open class RumViewScope( context = ErrorEvent.Context(additionalProperties = updatedAttributes), dd = ErrorEvent.Dd( session = ErrorEvent.DdSession( - plan = ErrorEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toErrorSessionPrecondition() ), configuration = ErrorEvent.Configuration(sessionSampleRate = sampleRate) @@ -853,7 +852,6 @@ internal open class RumViewScope( dd = ViewEvent.Dd( documentVersion = eventVersion, session = ViewEvent.DdSession( - plan = ViewEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toViewSessionPrecondition() ), replayStats = replayStats, @@ -994,7 +992,6 @@ internal open class RumViewScope( ), dd = ActionEvent.Dd( session = ActionEvent.DdSession( - plan = ActionEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toActionSessionPrecondition() ), configuration = ActionEvent.Configuration(sessionSampleRate = sampleRate) @@ -1096,7 +1093,6 @@ internal open class RumViewScope( context = LongTaskEvent.Context(additionalProperties = updatedAttributes), dd = LongTaskEvent.Dd( session = LongTaskEvent.DdSession( - plan = LongTaskEvent.Plan.PLAN_1, sessionPrecondition = rumContext.sessionStartReason.toLongTaskSessionPrecondition() ), configuration = LongTaskEvent.Configuration(sessionSampleRate = sampleRate) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ActionEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ActionEventAssert.kt index 4a836df5e1..00ed2c14e4 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ActionEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ActionEventAssert.kt @@ -324,16 +324,6 @@ internal class ActionEventAssert(actual: ActionEvent) : return this } - fun hasLiteSessionPlan(): ActionEventAssert { - assertThat(actual.dd.session?.plan) - .overridingErrorMessage( - "Expected event to have a session plan of 1 instead it was %s", - actual.dd.session?.plan ?: "null" - ) - .isEqualTo(ActionEvent.Plan.PLAN_1) - return this - } - fun hasStartReason(reason: RumSessionScope.StartReason): ActionEventAssert { assertThat(actual.dd.session?.sessionPrecondition) .overridingErrorMessage( diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ErrorEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ErrorEventAssert.kt index d9fc83fccc..0d22cdab63 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ErrorEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ErrorEventAssert.kt @@ -414,16 +414,6 @@ internal class ErrorEventAssert(actual: ErrorEvent) : return this } - fun hasLiteSessionPlan(): ErrorEventAssert { - assertThat(actual.dd.session?.plan) - .overridingErrorMessage( - "Expected event to have a session plan of 1 instead it was %s", - actual.dd.session?.plan ?: "null" - ) - .isEqualTo(ErrorEvent.Plan.PLAN_1) - return this - } - fun hasStartReason(reason: RumSessionScope.StartReason): ErrorEventAssert { assertThat(actual.dd.session?.sessionPrecondition) .overridingErrorMessage( diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/LongTaskEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/LongTaskEventAssert.kt index 5cbb76fd22..f91f809ccd 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/LongTaskEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/LongTaskEventAssert.kt @@ -238,16 +238,6 @@ internal class LongTaskEventAssert(actual: LongTaskEvent) : return this } - fun hasLiteSessionPlan(): LongTaskEventAssert { - assertThat(actual.dd.session?.plan) - .overridingErrorMessage( - "Expected event to have a session plan of 1 instead it was %s", - actual.dd.session?.plan ?: "null" - ) - .isEqualTo(LongTaskEvent.Plan.PLAN_1) - return this - } - fun hasStartReason(reason: RumSessionScope.StartReason): LongTaskEventAssert { assertThat(actual.dd.session?.sessionPrecondition) .overridingErrorMessage( diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ResourceEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ResourceEventAssert.kt index 8b2ddcfae6..8420583da8 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ResourceEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ResourceEventAssert.kt @@ -499,16 +499,6 @@ internal class ResourceEventAssert(actual: ResourceEvent) : return this } - fun hasLiteSessionPlan(): ResourceEventAssert { - assertThat(actual.dd.session?.plan) - .overridingErrorMessage( - "Expected event to have a session plan of 1 instead it was %s", - actual.dd.session?.plan ?: "null" - ) - .isEqualTo(ResourceEvent.Plan.PLAN_1) - return this - } - fun hasStartReason(reason: RumSessionScope.StartReason): ResourceEventAssert { assertThat(actual.dd.session?.sessionPrecondition) .overridingErrorMessage( diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ViewEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ViewEventAssert.kt index 890184b7c3..24737fd63f 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ViewEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/assertj/ViewEventAssert.kt @@ -505,16 +505,6 @@ internal class ViewEventAssert(actual: ViewEvent) : return this } - fun hasLiteSessionPlan(): ViewEventAssert { - assertThat(actual.dd.session?.plan) - .overridingErrorMessage( - "Expected event to have a session plan of 1 instead it was %s", - actual.dd.session?.plan ?: "null" - ) - .isEqualTo(ViewEvent.Plan.PLAN_1) - return this - } - fun hasStartReason(reason: RumSessionScope.StartReason): ViewEventAssert { assertThat(actual.dd.session?.sessionPrecondition) .overridingErrorMessage( diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporterTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporterTest.kt index e700c9b621..3c311d5637 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporterTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporterTest.kt @@ -189,7 +189,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(fakeSignalName) .hasErrorCategory(ErrorEvent.Category.EXCEPTION) .hasTimeSinceAppStart(fakeTimeSinceAppStartMs) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, @@ -290,7 +289,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(fakeSignalName) .hasErrorCategory(ErrorEvent.Category.EXCEPTION) .hasTimeSinceAppStart(fakeTimeSinceAppStartMs) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, @@ -435,7 +433,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(fakeSignalName) .hasErrorCategory(ErrorEvent.Category.EXCEPTION) .hasTimeSinceAppStart(fakeTimeSinceAppStartMs) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, @@ -538,7 +535,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(fakeSignalName) .hasErrorCategory(ErrorEvent.Category.EXCEPTION) .hasTimeSinceAppStart(fakeTimeSinceAppStartMs) - .hasLiteSessionPlan() .hasSource(expectedErrorEventSource) .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, @@ -735,7 +731,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(ANRException::class.java.canonicalName) .hasErrorCategory(ErrorEvent.Category.ANR) .hasTimeSinceAppStart(null) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, @@ -818,7 +813,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(ANRException::class.java.canonicalName) .hasErrorCategory(ErrorEvent.Category.ANR) .hasTimeSinceAppStart(null) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, @@ -913,7 +907,6 @@ internal class DatadogLateCrashReporterTest { .hasErrorType(ANRException::class.java.canonicalName) .hasErrorCategory(ErrorEvent.Category.ANR) .hasTimeSinceAppStart(null) - .hasLiteSessionPlan() .hasDeviceInfo( fakeDatadogContext.deviceInfo.deviceName, fakeDatadogContext.deviceInfo.deviceModel, diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScopeTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScopeTest.kt index a357af3e21..6ecd4c5c78 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScopeTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScopeTest.kt @@ -249,7 +249,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -356,7 +355,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -442,7 +440,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -581,7 +578,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -655,7 +651,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -715,7 +710,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -786,7 +780,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -866,7 +859,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -926,7 +918,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -985,7 +976,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1049,7 +1039,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1116,7 +1105,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1175,7 +1163,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1234,7 +1221,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1298,7 +1284,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1364,7 +1349,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1453,7 +1437,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1535,7 +1518,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1601,7 +1583,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1658,7 +1639,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1718,7 +1698,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1782,7 +1761,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1847,7 +1825,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1903,7 +1880,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -1964,7 +1940,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2023,7 +1998,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2082,7 +2056,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2141,7 +2114,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2202,7 +2174,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2293,7 +2264,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2349,7 +2319,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2405,7 +2374,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2461,7 +2429,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(fakeAttributes) @@ -2554,7 +2521,6 @@ internal class RumActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumContinuousActionScopeTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumContinuousActionScopeTest.kt index ff72b4c2ec..493dfd1641 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumContinuousActionScopeTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumContinuousActionScopeTest.kt @@ -243,7 +243,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -311,7 +310,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceActionEvent) @@ -377,7 +375,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceActionEvent) @@ -446,7 +443,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -529,7 +525,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -617,7 +612,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasDeviceInfo( @@ -686,7 +680,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -763,7 +756,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -834,7 +826,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -913,7 +904,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -967,7 +957,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1025,7 +1014,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1083,7 +1071,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1146,7 +1133,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1211,7 +1197,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1267,7 +1252,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1357,7 +1341,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceActionEvent) @@ -1440,7 +1423,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceActionEvent) @@ -1508,7 +1490,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceActionEvent) @@ -1570,7 +1551,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1636,7 +1616,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1703,7 +1682,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1763,7 +1741,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1827,7 +1804,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -1887,7 +1863,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -2014,7 +1989,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -2078,7 +2052,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) @@ -2136,7 +2109,6 @@ internal class RumContinuousActionScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceActionEvent) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScopeTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScopeTest.kt index 08f7ed80ce..903c74e0fa 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScopeTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScopeTest.kt @@ -276,7 +276,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -345,7 +344,6 @@ internal class RumResourceScopeTest { hasRulePsr(null) hasProviderType(ResourceEvent.ProviderType.FIRST_PARTY) hasProviderDomain(URL(fakeUrl).host) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -430,7 +428,6 @@ internal class RumResourceScopeTest { hasRulePsr(null) hasProviderType(ResourceEvent.ProviderType.FIRST_PARTY) hasProviderDomain(brokenUrl) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -508,7 +505,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -579,7 +575,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -668,7 +663,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -730,7 +724,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(fakeAttributes) hasSource(fakeSourceResourceEvent) @@ -780,7 +773,6 @@ internal class RumResourceScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeParentContext.actionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -910,7 +902,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -982,7 +973,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -1055,7 +1045,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -1129,7 +1118,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasSource(fakeSourceResourceEvent) @@ -1204,7 +1192,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1284,7 +1271,6 @@ internal class RumResourceScopeTest { hasUserSession() hasErrorFingerprint(fakeFingerprint) hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1361,7 +1347,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1455,7 +1440,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1552,7 +1536,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1644,7 +1627,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1739,7 +1721,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1818,7 +1799,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1899,7 +1879,6 @@ internal class RumResourceScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -1977,7 +1956,6 @@ internal class RumResourceScopeTest { hasUserSession() hasNoSyntheticsTest() doesNotHaveAResourceProvider() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2058,7 +2036,6 @@ internal class RumResourceScopeTest { hasUserSession() hasNoSyntheticsTest() doesNotHaveAResourceProvider() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2142,7 +2119,6 @@ internal class RumResourceScopeTest { hasUserSession() hasNoSyntheticsTest() doesNotHaveAResourceProvider() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2228,7 +2204,6 @@ internal class RumResourceScopeTest { hasUserSession() hasNoSyntheticsTest() doesNotHaveAResourceProvider() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2388,7 +2363,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2456,7 +2430,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2526,7 +2499,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(expectedAttributes) @@ -2645,7 +2617,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasSource(fakeSourceResourceEvent) @@ -2713,7 +2684,6 @@ internal class RumResourceScopeTest { doesNotHaveAResourceProvider() hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasSource(fakeSourceResourceEvent) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScopeTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScopeTest.kt index 41992ccd62..5420166e32 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScopeTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScopeTest.kt @@ -894,7 +894,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -968,7 +967,6 @@ internal class RumViewScopeTest { hasUserSession() hasNoSyntheticsTest() containsExactlyContextAttributes(fakeAttributes) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1043,7 +1041,6 @@ internal class RumViewScopeTest { hasUserSession() hasNoSyntheticsTest() containsExactlyContextAttributes(expectedAttributes) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1123,7 +1120,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasReplay(fakeHasReplay) @@ -1201,7 +1197,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasReplay(fakeHasReplay) @@ -1279,7 +1274,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) containsExactlyContextAttributes(expectedAttributes) hasReplay(fakeHasReplay) @@ -1345,7 +1339,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1439,7 +1432,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1532,7 +1524,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1627,7 +1618,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1725,7 +1715,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1803,7 +1792,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1880,7 +1868,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -1993,7 +1980,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -2065,7 +2051,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) // TODO RUMM-3316 if viewId changes, we need to relink replay as well. hasReplay(false) @@ -2155,7 +2140,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -2227,7 +2211,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) // TODO RUMM-3316 if viewId changes, we need to relink replay as well. hasReplay(false) @@ -2318,7 +2301,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -2391,7 +2373,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) // TODO RUMM-3316 if viewId changes, we need to relink replay as well. hasReplay(false) @@ -2484,7 +2465,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -2559,7 +2539,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) // TODO RUMM-3316 if viewId changes, we need to relink replay as well. hasReplay(false) @@ -2632,7 +2611,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -2707,7 +2685,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) // TODO RUMM-3316 if viewId changes, we need to relink replay as well. hasReplay(false) @@ -2792,7 +2769,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(false) hasSource(fakeSourceActionEvent) @@ -2860,7 +2836,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(false) hasSource(fakeSourceActionEvent) @@ -2926,7 +2901,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3016,7 +2990,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3108,7 +3081,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3199,7 +3171,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3285,7 +3256,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(false) hasSource(fakeSourceActionEvent) @@ -3344,7 +3314,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(false) hasSource(fakeSourceActionEvent) @@ -3423,7 +3392,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3626,7 +3594,6 @@ internal class RumViewScopeTest { hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) containsExactlyContextAttributes(expectedAttributes) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -3821,7 +3788,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -3891,7 +3857,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4478,7 +4443,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4559,7 +4523,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4632,7 +4595,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4705,7 +4667,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4780,7 +4741,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4857,7 +4817,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4927,7 +4886,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -4991,7 +4949,6 @@ internal class RumViewScopeTest { hasErrorSourceType(sourceType.toSchemaSourceType()) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5069,7 +5026,6 @@ internal class RumViewScopeTest { hasErrorSourceType(sourceType.toSchemaSourceType()) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5149,7 +5105,6 @@ internal class RumViewScopeTest { hasTimeSinceAppStart(TimeUnit.NANOSECONDS.toMillis(timeSinceAppStart)) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5201,7 +5156,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -5279,7 +5233,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(mockAttributes) @@ -5359,7 +5312,6 @@ internal class RumViewScopeTest { hasErrorSourceType(sourceType.toSchemaSourceType()) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5441,7 +5393,6 @@ internal class RumViewScopeTest { hasTimeSinceAppStart(TimeUnit.NANOSECONDS.toMillis(timeSinceAppStart)) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5493,7 +5444,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -5590,7 +5540,6 @@ internal class RumViewScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5639,7 +5588,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -5718,7 +5666,6 @@ internal class RumViewScopeTest { hasTimeSinceAppStart(null) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5799,7 +5746,6 @@ internal class RumViewScopeTest { hasErrorSourceType(sourceType.toSchemaSourceType()) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5882,7 +5828,6 @@ internal class RumViewScopeTest { hasTimeSinceAppStart(TimeUnit.NANOSECONDS.toMillis(timeSinceAppStart)) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) containsExactlyContextAttributes(attributes) @@ -5934,7 +5879,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -6195,7 +6139,6 @@ internal class RumViewScopeTest { hasView(testedScope.viewId, testedScope.url) hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -6250,7 +6193,6 @@ internal class RumViewScopeTest { hasView(testedScope.viewId, testedScope.url) hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -6314,7 +6256,6 @@ internal class RumViewScopeTest { hasView(testedScope.viewId, testedScope.url) hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) @@ -6378,7 +6319,6 @@ internal class RumViewScopeTest { hasView(testedScope.viewId, testedScope.url) hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasSyntheticsSession() hasSyntheticsTest(fakeTestId, fakeResultId) @@ -6442,7 +6382,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -6507,7 +6446,6 @@ internal class RumViewScopeTest { hasApplicationId(fakeParentContext.applicationId) hasSessionId(fakeParentContext.sessionId) hasActionId(fakeActionId) - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasUserSession() hasNoSyntheticsTest() @@ -6828,7 +6766,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -6905,7 +6842,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -6960,7 +6896,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -7067,7 +7002,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -7144,7 +7078,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -7220,7 +7153,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -7306,7 +7238,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) @@ -7392,7 +7323,6 @@ internal class RumViewScopeTest { hasSessionId(fakeParentContext.sessionId) hasUserSession() hasNoSyntheticsTest() - hasLiteSessionPlan() hasStartReason(fakeParentContext.sessionStartReason) hasReplay(fakeHasReplay) hasReplayStats(fakeReplayStats) diff --git a/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumer.kt b/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumer.kt index 5247126bb2..f9384be3b7 100644 --- a/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumer.kt +++ b/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumer.kt @@ -13,6 +13,7 @@ import com.datadog.android.api.feature.Feature import com.datadog.android.api.feature.FeatureSdkCore import com.datadog.android.api.storage.DataWriter import com.datadog.android.webview.internal.WebViewEventConsumer +import com.datadog.android.webview.internal.replay.WebViewReplayEventConsumer import com.datadog.android.webview.internal.rum.domain.RumContext import com.google.gson.JsonObject import java.lang.IllegalStateException @@ -41,7 +42,13 @@ internal class WebViewRumEventConsumer( ?.withWriteContext { datadogContext, eventBatchWriter -> val rumContext = contextProvider.getRumContext(datadogContext) if (rumContext != null && rumContext.sessionState == "TRACKED") { - val mappedEvent = map(event, datadogContext, rumContext) + val sessionReplayFeatureContext = datadogContext.featuresContext[ + Feature.SESSION_REPLAY_FEATURE_NAME + ] + val sessionReplayEnabled = sessionReplayFeatureContext?.get( + WebViewReplayEventConsumer.SESSION_REPLAY_ENABLED_KEY + ) as? Boolean ?: false + val mappedEvent = map(event, datadogContext, rumContext, sessionReplayEnabled) @Suppress("ThreadSafety") // inside worker thread context dataWriter.write(eventBatchWriter, mappedEvent) } @@ -51,12 +58,13 @@ internal class WebViewRumEventConsumer( private fun map( event: JsonObject, datadogContext: DatadogContext, - rumContext: RumContext? + rumContext: RumContext?, + sessionReplayEnabled: Boolean ): JsonObject { try { val timeOffset = event.get(VIEW_KEY_NAME)?.asJsonObject?.get(VIEW_ID_KEY_NAME) ?.asString?.let { offsetProvider.getOffset(it, datadogContext) } ?: 0L - return webViewRumEventMapper.mapEvent(event, rumContext, timeOffset) + return webViewRumEventMapper.mapEvent(event, rumContext, timeOffset, sessionReplayEnabled) } catch (e: ClassCastException) { sdkCore.internalLogger.log( InternalLogger.Level.ERROR, diff --git a/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapper.kt b/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapper.kt index 52ca376bc3..74be158dea 100644 --- a/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapper.kt +++ b/features/dd-sdk-android-webview/src/main/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapper.kt @@ -22,7 +22,8 @@ internal class WebViewRumEventMapper( fun mapEvent( event: JsonObject, rumContext: RumContext?, - timeOffset: Long + timeOffset: Long, + sessionReplayEnabled: Boolean ): JsonObject { val containerObject = JsonObject().apply { addProperty(SOURCE_KEY_NAME, SOURCE_VALUE) @@ -42,18 +43,23 @@ internal class WebViewRumEventMapper( val dd = event.get(DD_KEY_NAME)?.asJsonObject if (dd != null) { val ddSession = dd.get(DD_SESSION_KEY_NAME)?.asJsonObject ?: JsonObject() - // TODO RUM-3785 It was ViewEvent.Plan.PLAN_1 here before, but removed in order not to - // depend on RUM module. We may want to generate RUM models also in this package, but - // they shouldn't be public. - ddSession.addProperty(SESSION_PLAN_KEY_NAME, SESSION_PLAN_VALUE) dd.add(DD_SESSION_KEY_NAME, ddSession) + if (!sessionReplayEnabled) { + // RUM-4084 disable webview SR if host app doesn't have SR + dd.remove(DD_REPLAY_STATS) + } } + if (rumContext != null) { val application = event.getAsJsonObject(APPLICATION_KEY_NAME)?.asJsonObject ?: JsonObject() val session = event.getAsJsonObject(SESSION_KEY_NAME)?.asJsonObject ?: JsonObject() application.addProperty(ID_KEY_NAME, rumContext.applicationId) session.addProperty(ID_KEY_NAME, rumContext.sessionId) + if (!sessionReplayEnabled) { + // RUM-4084 disable webview SR if host app doesn't have SR + session.remove(SESSION_HAS_REPLAY_NAME) + } event.add(APPLICATION_KEY_NAME, application) event.add(SESSION_KEY_NAME, session) } @@ -66,10 +72,10 @@ internal class WebViewRumEventMapper( internal const val SESSION_KEY_NAME = "session" internal const val DD_KEY_NAME = "_dd" internal const val DD_SESSION_KEY_NAME = "session" - internal const val SESSION_PLAN_KEY_NAME = "plan" + internal const val DD_REPLAY_STATS = "replay_stats" internal const val DATE_KEY_NAME = "date" internal const val ID_KEY_NAME = "id" - internal const val SESSION_PLAN_VALUE = 1 + internal const val SESSION_HAS_REPLAY_NAME = "has_replay" internal const val VIEW_KEY_NAME = "view" internal const val CONTAINER_KEY_NAME = "container" internal const val SOURCE_KEY_NAME = "source" diff --git a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/utils/forge/ViewEventForgeryFactory.kt b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/utils/forge/ViewEventForgeryFactory.kt index 4f4c5ed223..c38c4fc31a 100644 --- a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/utils/forge/ViewEventForgeryFactory.kt +++ b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/utils/forge/ViewEventForgeryFactory.kt @@ -125,9 +125,16 @@ internal class ViewEventForgeryFactory : ForgeryFactory { ) }, dd = ViewEvent.Dd( - session = forge.aNullable { ViewEvent.DdSession(aNullable { getForgery() }) }, + session = forge.aNullable { ViewEvent.DdSession(null, getForgery()) }, browserSdkVersion = forge.aNullable { aStringMatching("\\d+\\.\\d+\\.\\d+") }, - documentVersion = forge.aPositiveLong(strict = true) + documentVersion = forge.aPositiveLong(strict = true), + replayStats = forge.aNullable { + ViewEvent.ReplayStats( + recordsCount = aLong(0), + segmentsCount = aLong(0), + segmentsTotalRawSize = aLong(0) + ) + } ) ) } diff --git a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumerTest.kt b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumerTest.kt index b6963fb5a6..0ba62a9834 100644 --- a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumerTest.kt +++ b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventConsumerTest.kt @@ -22,10 +22,12 @@ import com.datadog.android.utils.forge.Configurator import com.datadog.android.utils.forge.aRumEventAsJson import com.datadog.android.utils.verifyLog import com.datadog.android.webview.internal.WebViewEventConsumer +import com.datadog.android.webview.internal.replay.WebViewReplayEventConsumer import com.datadog.android.webview.internal.rum.domain.RumContext import com.google.gson.JsonArray import com.google.gson.JsonObject import fr.xgouchet.elmyr.Forge +import fr.xgouchet.elmyr.annotation.BoolForgery import fr.xgouchet.elmyr.annotation.Forgery import fr.xgouchet.elmyr.annotation.LongForgery import fr.xgouchet.elmyr.junit5.ForgeConfiguration @@ -106,6 +108,9 @@ internal class WebViewRumEventConsumerTest { @Mock lateinit var mockOffsetProvider: TimestampOffsetProvider + @BoolForgery + var fakeSessionReplayEnabled = false + @BeforeEach fun `set up`(forge: Forge) { fakeRumContext = fakeRumContext.copy(sessionState = "TRACKED") @@ -117,10 +122,16 @@ internal class WebViewRumEventConsumerTest { emptyMap() } + val fakeFeaturesContext = mapOf( + Feature.SESSION_REPLAY_FEATURE_NAME to mapOf( + WebViewReplayEventConsumer.SESSION_REPLAY_ENABLED_KEY to fakeSessionReplayEnabled + ) + ) fakeDatadogContext = fakeDatadogContext.copy( time = fakeDatadogContext.time.copy( serverTimeOffsetMs = fakeServerTimeOffsetInMillis - ) + ), + featuresContext = fakeFeaturesContext ) whenever( @@ -171,7 +182,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeViewEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedViewEvent) @@ -196,7 +208,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeViewEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedViewEvent) @@ -217,7 +230,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeViewEventAsJson, null, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedViewEvent) @@ -245,7 +259,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeActionEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedActionEvent) @@ -269,7 +284,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeActionEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedActionEvent) @@ -290,7 +306,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeActionEventAsJson, null, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedActionEvent) @@ -318,7 +335,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeResourceEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedResourceEvent) @@ -342,7 +360,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeResourceEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedResourceEvent) @@ -363,7 +382,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeResourceEventAsJson, null, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedResourceEvent) @@ -391,7 +411,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeErrorEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedErrorEvent) @@ -415,7 +436,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeErrorEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedErrorEvent) @@ -436,7 +458,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeErrorEventAsJson, null, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedErrorEvent) @@ -464,7 +487,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeLongTaskEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedLongTaskEvent) @@ -488,7 +512,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeLongTaskEventAsJson, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ) .thenReturn(fakeMappedLongTaskEvent) @@ -510,7 +535,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeLongTaskEventAsJson, null, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedLongTaskEvent) @@ -537,7 +563,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeRumEvent, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenThrow(fakeException) @@ -557,7 +584,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeRumEvent, fakeRumContext, - fakeServerTimeOffsetInMillis + fakeServerTimeOffsetInMillis, + fakeSessionReplayEnabled ) ).thenThrow(fakeException) @@ -583,7 +611,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeRumEvent, fakeRumContext, - 0 + 0, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedRumEvent) @@ -605,7 +634,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeRumEvent, fakeRumContext, - 0 + 0, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedRumEvent) @@ -627,7 +657,8 @@ internal class WebViewRumEventConsumerTest { mockWebViewRumEventMapper.mapEvent( fakeRumEvent, fakeRumContext, - 0 + 0, + fakeSessionReplayEnabled ) ).thenReturn(fakeMappedRumEvent) diff --git a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperTest.kt b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperTest.kt index b11a5d317b..90940c5f4b 100644 --- a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperTest.kt +++ b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperTest.kt @@ -70,7 +70,7 @@ internal class WebViewRumEventMapperTest { } @Test - fun `M map the event W mapEvent { ViewEvent }()`(forge: Forge) { + fun `M map the event W mapEvent { ViewEvent }`(forge: Forge) { // Given val fakeViewEvent = forge.getForgery() whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeViewEvent.date)) @@ -81,7 +81,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -104,7 +105,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -127,7 +129,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -150,7 +153,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -162,7 +166,7 @@ internal class WebViewRumEventMapperTest { } @Test - fun `M map the event W mapEvent { LongTaskEvent }()`(forge: Forge) { + fun `M map the event W mapEvent { LongTaskEvent }`(forge: Forge) { // Given val fakeLongTaskEvent = forge.getForgery() val fakeRumJsonObject = fakeLongTaskEvent.toJson().asJsonObject @@ -173,7 +177,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -185,7 +190,7 @@ internal class WebViewRumEventMapperTest { } @Test - fun `M map the event W mapEvent { missing application and session fields }()`(forge: Forge) { + fun `M map the event W mapEvent { missing application and session fields }`(forge: Forge) { // Given val fakeLongTaskEvent = forge.getForgery() val fakeRumJsonObject = fakeLongTaskEvent.toJson().asJsonObject.apply { @@ -199,7 +204,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, fakeRumContext, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -232,7 +238,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, null, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -254,13 +261,6 @@ internal class WebViewRumEventMapperTest { WebViewRumEventMapper.DATE_KEY_NAME, expectedDate ) - val ddSession = mappedEvent - .getAsJsonObject(WebViewRumEventMapper.DD_KEY_NAME) - .get(WebViewRumEventMapper.DD_SESSION_KEY_NAME).asJsonObject - assertThat(ddSession).hasField( - WebViewRumEventMapper.SESSION_PLAN_KEY_NAME, - ViewEvent.Plan.PLAN_1.toJson().asLong - ) val container = mappedEvent.getAsJsonObject(WebViewRumEventMapper.CONTAINER_KEY_NAME) assertThat(container).hasField( WebViewRumEventMapper.SOURCE_KEY_NAME, @@ -282,7 +282,8 @@ internal class WebViewRumEventMapperTest { val mappedEvent = testedWebViewRumEventMapper.mapEvent( fakeRumJsonObject, null, - fakeServerTimeOffset + fakeServerTimeOffset, + true ) // Then @@ -328,13 +329,6 @@ internal class WebViewRumEventMapperTest { WebViewRumEventMapper.DATE_KEY_NAME, expectedDate ) - val ddSession = mappedEvent - .getAsJsonObject(WebViewRumEventMapper.DD_KEY_NAME) - .get(WebViewRumEventMapper.DD_SESSION_KEY_NAME).asJsonObject - assertThat(ddSession).hasField( - WebViewRumEventMapper.SESSION_PLAN_KEY_NAME, - ViewEvent.Plan.PLAN_1.toJson().asLong - ) val container = mappedEvent.getAsJsonObject(WebViewRumEventMapper.CONTAINER_KEY_NAME) assertThat(container).hasField( WebViewRumEventMapper.SOURCE_KEY_NAME, diff --git a/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperWithoutSRTest.kt b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperWithoutSRTest.kt new file mode 100644 index 0000000000..3699c64127 --- /dev/null +++ b/features/dd-sdk-android-webview/src/test/kotlin/com/datadog/android/webview/internal/rum/WebViewRumEventMapperWithoutSRTest.kt @@ -0,0 +1,346 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.webview.internal.rum + +import com.datadog.android.rum.model.ActionEvent +import com.datadog.android.rum.model.ErrorEvent +import com.datadog.android.rum.model.LongTaskEvent +import com.datadog.android.rum.model.ResourceEvent +import com.datadog.android.rum.model.ViewEvent +import com.datadog.android.utils.forge.Configurator +import com.datadog.android.utils.forge.aRumEventAsJson +import com.datadog.android.webview.internal.rum.domain.NativeRumViewsCache +import com.datadog.android.webview.internal.rum.domain.RumContext +import com.datadog.tools.unit.assertj.JsonObjectAssert.Companion.assertThat +import com.google.gson.JsonObject +import fr.xgouchet.elmyr.Forge +import fr.xgouchet.elmyr.annotation.Forgery +import fr.xgouchet.elmyr.annotation.LongForgery +import fr.xgouchet.elmyr.annotation.StringForgery +import fr.xgouchet.elmyr.junit5.ForgeConfiguration +import fr.xgouchet.elmyr.junit5.ForgeExtension +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +import org.junit.jupiter.api.extension.Extensions +import org.mockito.Mock +import org.mockito.junit.jupiter.MockitoExtension +import org.mockito.junit.jupiter.MockitoSettings +import org.mockito.kotlin.whenever +import org.mockito.quality.Strictness + +@Extensions( + ExtendWith(MockitoExtension::class), + ExtendWith(ForgeExtension::class) +) +@MockitoSettings(strictness = Strictness.LENIENT) +@ForgeConfiguration(Configurator::class) +internal class WebViewRumEventMapperWithoutSRTest { + + lateinit var testedWebViewRumEventMapper: WebViewRumEventMapper + + @LongForgery + var fakeServerTimeOffset: Long = 0L + + @Forgery + lateinit var fakeRumContext: RumContext + + @Mock + lateinit var mockNativeRumViewsCache: NativeRumViewsCache + + @StringForgery + lateinit var fakeResolvedNativeViewId: String + + lateinit var fakeTags: Map + + @BeforeEach + fun `set up`(forge: Forge) { + fakeTags = if (forge.aBool()) { + forge.aMap { + forge.anAlphabeticalString() to forge.anAlphaNumericalString() + } + } else { + emptyMap() + } + testedWebViewRumEventMapper = WebViewRumEventMapper(mockNativeRumViewsCache) + } + + @Test + fun `M map the event W mapEvent { ViewEvent }`(forge: Forge) { + // Given + val fakeViewEvent = forge.getForgery() + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeViewEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + val fakeRumJsonObject = fakeViewEvent.toJson().asJsonObject + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeViewEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { ActionEvent }`(forge: Forge) { + // Given + val fakeActionEvent = forge.getForgery() + val fakeRumJsonObject = fakeActionEvent.toJson().asJsonObject + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeActionEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeActionEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { ErrorEvent }`(forge: Forge) { + // Given + val fakeErrorEvent = forge.getForgery() + val fakeRumJsonObject = fakeErrorEvent.toJson().asJsonObject + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeErrorEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeErrorEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { ResourceEvent }`(forge: Forge) { + // Given + val fakeResourceEvent = forge.getForgery() + val fakeRumJsonObject = fakeResourceEvent.toJson().asJsonObject + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeResourceEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeResourceEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { LongTaskEvent }`(forge: Forge) { + // Given + val fakeLongTaskEvent = forge.getForgery() + val fakeRumJsonObject = fakeLongTaskEvent.toJson().asJsonObject + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeLongTaskEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeLongTaskEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { missing application and session fields }`(forge: Forge) { + // Given + val fakeLongTaskEvent = forge.getForgery() + val fakeRumJsonObject = fakeLongTaskEvent.toJson().asJsonObject.apply { + remove(WebViewRumEventMapper.APPLICATION_KEY_NAME) + remove(WebViewRumEventMapper.SESSION_KEY_NAME) + } + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeLongTaskEvent.date)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + fakeRumContext, + fakeServerTimeOffset, + false + ) + + // Then + assertMappedEvent( + fakeRumJsonObject, + fakeLongTaskEvent.date + fakeServerTimeOffset, + mappedEvent + ) + } + + @Test + fun `M map the event W mapEvent { RumContext is missing }`(forge: Forge) { + // Given + val fakeRumJsonObject = forge.aRumEventAsJson() + val fakeEventDate = fakeRumJsonObject.get(WebViewRumEventMapper.DATE_KEY_NAME).asLong + val expectedDate = fakeEventDate + + fakeServerTimeOffset + val expectedApplicationId = fakeRumJsonObject + .getAsJsonObject(WebViewRumEventMapper.APPLICATION_KEY_NAME) + .getAsJsonPrimitive(WebViewRumEventMapper.ID_KEY_NAME) + .asString + val expectedSessionId = fakeRumJsonObject + .getAsJsonObject(WebViewRumEventMapper.SESSION_KEY_NAME) + .getAsJsonPrimitive(WebViewRumEventMapper.ID_KEY_NAME) + .asString + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeEventDate)) + .thenReturn(fakeResolvedNativeViewId) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + null, + fakeServerTimeOffset, + false + ) + + // Then + assertThat(mappedEvent) + .usingRecursiveComparison() + .ignoringFields( + WebViewRumEventMapper.APPLICATION_KEY_NAME, + WebViewRumEventMapper.SESSION_KEY_NAME, + WebViewRumEventMapper.DATE_KEY_NAME, + WebViewRumEventMapper.DD_KEY_NAME, + WebViewRumEventMapper.CONTAINER_KEY_NAME + ) + .isEqualTo(fakeRumJsonObject) + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.APPLICATION_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, expectedApplicationId) + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.SESSION_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, expectedSessionId) + assertThat(mappedEvent).hasField( + WebViewRumEventMapper.DATE_KEY_NAME, + expectedDate + ) + val container = mappedEvent.getAsJsonObject(WebViewRumEventMapper.CONTAINER_KEY_NAME) + assertThat(container).hasField( + WebViewRumEventMapper.SOURCE_KEY_NAME, + WebViewRumEventMapper.SOURCE_VALUE + ) + assertThat(container.getAsJsonObject(WebViewRumEventMapper.VIEW_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, fakeResolvedNativeViewId) + } + + @Test + fun `M map the event W mapEvent { parent native id could not be resolved }`(forge: Forge) { + // Given + val fakeRumJsonObject = forge.aRumEventAsJson() + val fakeEventDate = fakeRumJsonObject.get(WebViewRumEventMapper.DATE_KEY_NAME).asLong + whenever(mockNativeRumViewsCache.resolveLastParentIdForBrowserEvent(fakeEventDate)) + .thenReturn(null) + + // When + val mappedEvent = testedWebViewRumEventMapper.mapEvent( + fakeRumJsonObject, + null, + fakeServerTimeOffset, + false + ) + + // Then + assertThat(mappedEvent) + .usingRecursiveComparison() + .ignoringFields( + WebViewRumEventMapper.APPLICATION_KEY_NAME, + WebViewRumEventMapper.SESSION_KEY_NAME, + WebViewRumEventMapper.DATE_KEY_NAME, + WebViewRumEventMapper.DD_KEY_NAME, + WebViewRumEventMapper.CONTAINER_KEY_NAME + ) + .isEqualTo(fakeRumJsonObject) + val container = mappedEvent + .getAsJsonObject(WebViewRumEventMapper.CONTAINER_KEY_NAME) + assertThat(container).hasField( + WebViewRumEventMapper.SOURCE_KEY_NAME, + WebViewRumEventMapper.SOURCE_VALUE + ) + assertThat(container).doesNotHaveField(WebViewRumEventMapper.VIEW_KEY_NAME) + } + + private fun assertMappedEvent( + expectedEvent: JsonObject, + expectedDate: Long, + mappedEvent: JsonObject + ) { + assertThat(mappedEvent) + .usingRecursiveComparison() + .ignoringFields( + WebViewRumEventMapper.APPLICATION_KEY_NAME, + WebViewRumEventMapper.SESSION_KEY_NAME, + WebViewRumEventMapper.DATE_KEY_NAME, + WebViewRumEventMapper.DD_KEY_NAME + ) + .isEqualTo(expectedEvent) + + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.APPLICATION_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, fakeRumContext.applicationId) + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.SESSION_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, fakeRumContext.sessionId) + .doesNotHaveField(WebViewRumEventMapper.SESSION_HAS_REPLAY_NAME) + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.SESSION_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, fakeRumContext.sessionId) + .doesNotHaveField(WebViewRumEventMapper.SESSION_HAS_REPLAY_NAME) + assertThat(mappedEvent.getAsJsonObject(WebViewRumEventMapper.DD_KEY_NAME)) + .doesNotHaveField(WebViewRumEventMapper.DD_REPLAY_STATS) + assertThat(mappedEvent).hasField( + WebViewRumEventMapper.DATE_KEY_NAME, + expectedDate + ) + val container = mappedEvent.getAsJsonObject(WebViewRumEventMapper.CONTAINER_KEY_NAME) + assertThat(container).hasField( + WebViewRumEventMapper.SOURCE_KEY_NAME, + WebViewRumEventMapper.SOURCE_VALUE + ) + assertThat(container.getAsJsonObject(WebViewRumEventMapper.VIEW_KEY_NAME)) + .hasField(WebViewRumEventMapper.ID_KEY_NAME, fakeResolvedNativeViewId) + } +}