From 7b4ecc72432159b655e84da18446d3e1c8b2867a Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Wed, 12 Feb 2025 13:40:56 +0500 Subject: [PATCH] added test --- .../customer/datapipelines/DataPipelinesInteractionTests.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datapipelines/src/test/java/io/customer/datapipelines/DataPipelinesInteractionTests.kt b/datapipelines/src/test/java/io/customer/datapipelines/DataPipelinesInteractionTests.kt index ae5e9894..83399720 100644 --- a/datapipelines/src/test/java/io/customer/datapipelines/DataPipelinesInteractionTests.kt +++ b/datapipelines/src/test/java/io/customer/datapipelines/DataPipelinesInteractionTests.kt @@ -15,6 +15,7 @@ import io.customer.datapipelines.testutils.utils.screenEvents import io.customer.datapipelines.testutils.utils.trackEvents import io.customer.sdk.core.di.SDKComponent import io.customer.sdk.data.model.CustomAttributes +import io.customer.sdk.data.model.Settings import io.customer.sdk.data.store.DeviceStore import io.customer.sdk.data.store.GlobalPreferenceStore import io.customer.sdk.util.EventNames @@ -593,6 +594,11 @@ class DataPipelinesInteractionTests : JUnitTest() { deviceRegisterEvent.context.deviceToken shouldBeEqualTo givenToken } + @Test + fun device_givenSDKInitialized_expectSettingsToBeStored() { + assertCalledOnce { globalPreferenceStore.saveSettings(Settings(writeKey = analytics.configuration.writeKey, apiHost = analytics.configuration.apiHost)) } + } + @Test fun device_givenRegisterTokenWhenNoProfileIdentified_expectStoreAndRegisterDeviceForAnonymousProfile() { val givenToken = String.random