From 6fb6f7cf6107c1d83fc85a6a360d807173cf98b3 Mon Sep 17 00:00:00 2001 From: rarawat Date: Tue, 28 Mar 2023 18:01:09 +0530 Subject: [PATCH] LIBMOBILE-1157 - removed onActivityStart and onActivityStop from QuantcastDestination. As it is not required when QuantcastClient.startQuantcast Used. - removed onActivityStart and onActivityStop test cases from QuantcastDestinationTests --- .../quantcast/QuantcastDestination.kt | 16 ------------ .../quantcast/QuantcastDestinationTests.kt | 26 ------------------- 2 files changed, 42 deletions(-) diff --git a/lib/src/main/java/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestination.kt b/lib/src/main/java/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestination.kt index 2a3d9f3..fe40c4e 100644 --- a/lib/src/main/java/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestination.kt +++ b/lib/src/main/java/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestination.kt @@ -61,22 +61,6 @@ class QuantcastDestination : DestinationPlugin(), AndroidLifecycle { return payload } - override fun onActivityStarted(activity: Activity?) { - super.onActivityStarted(activity) - if(quantcastSettings != null) { - QuantcastClient.activityStart(activity) - analytics.log( - "QuantcastClient.activityStart(activity)" - ) - } - } - - override fun onActivityStopped(activity: Activity?) { - super.onActivityStopped(activity) - analytics.log("QuantcastClient.activityStop()") - QuantcastClient.activityStop() - } - override fun onActivityCreated(activity: Activity?, savedInstanceState: Bundle?) { super.onActivityCreated(activity, savedInstanceState) } diff --git a/lib/src/test/kotlin/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestinationTests.kt b/lib/src/test/kotlin/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestinationTests.kt index 2cbbcc9..990e29e 100644 --- a/lib/src/test/kotlin/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestinationTests.kt +++ b/lib/src/test/kotlin/com/segment/analytics/kotlin/destinations/quantcast/QuantcastDestinationTests.kt @@ -1,9 +1,7 @@ package com.segment.analytics.kotlin.destinations.quantcast -import android.app.Activity import android.app.Application import android.content.Context -import android.content.Intent import com.quantcast.measurement.service.QuantcastClient import com.segment.analytics.kotlin.core.* import com.segment.analytics.kotlin.core.platform.Plugin @@ -82,30 +80,6 @@ class QuantcastDestinationTests { verify { QuantcastClient.enableLogging(true) } } - @Test - fun `activity started handled correctly`() { - val settings = mockkClass(QuantcastSettings::class) - mockedQuantcastDestination.quantcastSettings = settings - val activity: Activity = mockkClass(Activity::class) - val intent: Intent = mockkClass(Intent::class) - every { activity.intent } returns intent - every { activity.applicationContext } returns mockedContext - every { mockedContext.checkCallingOrSelfPermission("android.permission.WAKE_LOCK") } returns -1 - mockedQuantcastDestination.onActivityStarted(activity) - verify { - QuantcastClient.activityStart(activity) - } - } - - @Test - fun `activity stopped handled correctly`() { - val activity: Activity = mockkClass(Activity::class) - val intent: Intent = mockkClass(Intent::class) - every { activity.intent } returns intent - mockedQuantcastDestination.onActivityStopped(activity) - verify { QuantcastClient.activityStop() } - } - @Test fun `identify handled correctly`() { val sampleEvent = IdentifyEvent(