Skip to content

Commit

Permalink
Merge pull request #6 from segment-integrations/development
Browse files Browse the repository at this point in the history
development to main
  • Loading branch information
RawatRaveena authored Mar 28, 2023
2 parents d854554 + 6fb6f7c commit 1e749c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 1e749c7

Please sign in to comment.