diff --git a/README.md b/README.md index 57625f7..658d0f1 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt b/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/appsflyer/ExampleInstrumentedTest.kt similarity index 70% rename from lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt rename to lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/appsflyer/ExampleInstrumentedTest.kt index 3686f35..0ff348c 100644 --- a/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt +++ b/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/appsflyer/ExampleInstrumentedTest.kt @@ -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. * @@ -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 + ) } } \ No newline at end of file diff --git a/lib/src/main/AndroidManifest.xml b/lib/src/main/AndroidManifest.xml index e5f5b96..883baa9 100644 --- a/lib/src/main/AndroidManifest.xml +++ b/lib/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.segment.analytics.kotlin.destinations.appsflyer"> \ No newline at end of file diff --git a/lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt b/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt similarity index 99% rename from lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt rename to lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt index f25ad29..ddb33c0 100644 --- a/lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt +++ b/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt @@ -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 diff --git a/lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt b/lib/src/test/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestinationTests.kt similarity index 91% rename from lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt rename to lib/src/test/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestinationTests.kt index c7155df..ae78c60 100644 --- a/lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt +++ b/lib/src/test/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestinationTests.kt @@ -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 @@ -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 @@ -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) } @@ -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) }