Skip to content

Commit

Permalink
update package name
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxi-zeng committed Mar 8, 2022
1 parent 2362146 commit 681630a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ implementation("com.segment.analytics.kotlin.destinations:appsflyer:1.4.4")
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.

```
import com.segment.analytics.kotlin.destinations.plugins.AppsflyerDestination
import com.segment.analytics.kotlin.destinations.appsflyer.AppsflyerDestination
```

Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.segment.analytics.kotlin.destinations.plugins
package com.segment.analytics.kotlin.destinations.appsflyer

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry

import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -19,6 +17,9 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.segment.analytics.kotlin.destinations.plugins.test", appContext.packageName)
Assert.assertEquals(
"com.segment.analytics.kotlin.destinations.appsflyer.test",
appContext.packageName
)
}
}
2 changes: 1 addition & 1 deletion lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.segment.analytics.kotlin.destinations.plugins">
package="com.segment.analytics.kotlin.destinations.appsflyer">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.segment.analytics.kotlin.destinations.plugins
package com.segment.analytics.kotlin.destinations.appsflyer

import android.app.Activity
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.segment.analytics.kotlin.destinations.plugins
package com.segment.analytics.kotlin.destinations.appsflyer

import android.app.Activity
import android.content.Context
Expand All @@ -7,23 +7,12 @@ import androidx.core.os.bundleOf
import com.appsflyer.AppsFlyerLib
import com.segment.analytics.kotlin.core.*
import com.segment.analytics.kotlin.core.platform.Plugin
import io.mockk.Called
import io.mockk.MockKAnnotations
import io.mockk.every
import com.segment.analytics.kotlin.destinations.appsflyer.AppsFlyerDestination
import io.mockk.*
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.verify
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.buildJsonArray
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.put
import kotlinx.serialization.json.add
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertNotNull
import kotlinx.serialization.json.*
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test

Expand Down Expand Up @@ -78,10 +67,10 @@ class AppsflyerDestinationTests {
appsflyerDestination.update(settingsBlob, Plugin.UpdateType.Initial)

/* assertions about config */
assertNotNull(appsflyerDestination.settings)
Assertions.assertNotNull(appsflyerDestination.settings)
with(appsflyerDestination.settings!!) {
assertTrue(trackAttributionData)
assertEquals("devKey", appsFlyerDevKey)
Assertions.assertTrue(trackAttributionData)
Assertions.assertEquals("devKey", appsFlyerDevKey)
}

verify { mockAppsflyer.init("devKey", isNull(inverse = true), mockContext) }
Expand Down Expand Up @@ -118,10 +107,10 @@ class AppsflyerDestinationTests {
appsflyerDestination.update(settingsBlob, Plugin.UpdateType.Initial)

/* assertions about config */
assertNotNull(appsflyerDestination.settings)
Assertions.assertNotNull(appsflyerDestination.settings)
with(appsflyerDestination.settings!!) {
assertFalse(trackAttributionData)
assertEquals("devKey", appsFlyerDevKey)
Assertions.assertFalse(trackAttributionData)
Assertions.assertEquals("devKey", appsFlyerDevKey)
}

verify { mockAppsflyer.init("devKey", isNull(), mockContext) }
Expand Down

0 comments on commit 681630a

Please sign in to comment.