From 05e3a239150f1695c67e821864aa5d213990af9e Mon Sep 17 00:00:00 2001 From: Rehan Date: Fri, 15 Sep 2023 01:34:31 +0500 Subject: [PATCH] fixed messagingpush tests --- .../processor/PushMessageProcessorTest.kt | 4 ++-- .../messagingpush/util/PushTrackingUtilTest.kt | 4 ++-- .../messagingpush/ModuleMessagingConfigTest.kt | 7 ++----- .../messagingpush/ModuleMessagingPushFCMTest.kt | 12 ++++++------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/messagingpush/src/androidTest/java/io/customer/messagingpush/processor/PushMessageProcessorTest.kt b/messagingpush/src/androidTest/java/io/customer/messagingpush/processor/PushMessageProcessorTest.kt index 893844f2c..2b16ee06d 100644 --- a/messagingpush/src/androidTest/java/io/customer/messagingpush/processor/PushMessageProcessorTest.kt +++ b/messagingpush/src/androidTest/java/io/customer/messagingpush/processor/PushMessageProcessorTest.kt @@ -3,7 +3,7 @@ package io.customer.messagingpush.processor import android.content.Intent import android.os.Bundle import androidx.test.ext.junit.runners.AndroidJUnit4 -import io.customer.commontest.BaseTest +import io.customer.commontest.BaseIntegrationTest import io.customer.messagingpush.MessagingPushModuleConfig import io.customer.messagingpush.ModuleMessagingPushFCM import io.customer.messagingpush.di.moduleConfig @@ -24,7 +24,7 @@ import org.mockito.kotlin.verifyNoInteractions import org.mockito.kotlin.whenever @RunWith(AndroidJUnit4::class) -class PushMessageProcessorTest : BaseTest() { +class PushMessageProcessorTest : BaseIntegrationTest() { private val modules = hashMapOf>() private val customerIOMock: CustomerIOInstance = mock() private val trackRepositoryMock: TrackRepository = mock() diff --git a/messagingpush/src/androidTest/java/io/customer/messagingpush/util/PushTrackingUtilTest.kt b/messagingpush/src/androidTest/java/io/customer/messagingpush/util/PushTrackingUtilTest.kt index 90e0c9a8f..5b47ddf07 100644 --- a/messagingpush/src/androidTest/java/io/customer/messagingpush/util/PushTrackingUtilTest.kt +++ b/messagingpush/src/androidTest/java/io/customer/messagingpush/util/PushTrackingUtilTest.kt @@ -2,7 +2,7 @@ package io.customer.messagingpush.util import android.os.Bundle import androidx.test.ext.junit.runners.AndroidJUnit4 -import io.customer.commontest.BaseTest +import io.customer.commontest.BaseIntegrationTest import io.customer.sdk.data.request.MetricEvent import io.customer.sdk.extensions.random import io.customer.sdk.repository.TrackRepository @@ -15,7 +15,7 @@ import org.mockito.kotlin.verify import org.mockito.kotlin.verifyNoInteractions @RunWith(AndroidJUnit4::class) -class PushTrackingUtilTest : BaseTest() { +class PushTrackingUtilTest : BaseIntegrationTest() { private lateinit var util: PushTrackingUtil diff --git a/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingConfigTest.kt b/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingConfigTest.kt index 52f279675..22ba7d6e9 100644 --- a/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingConfigTest.kt +++ b/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingConfigTest.kt @@ -1,7 +1,6 @@ package io.customer.messagingpush -import androidx.test.ext.junit.runners.AndroidJUnit4 -import io.customer.commontest.BaseTest +import io.customer.commontest.BaseUnitTest import io.customer.messagingpush.data.communication.CustomerIOPushNotificationCallback import io.customer.messagingpush.di.moduleConfig import io.customer.sdk.CustomerIOConfig @@ -14,13 +13,11 @@ import org.amshove.kluent.shouldBeTrue import org.amshove.kluent.shouldNotBeNull import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith import org.mockito.kotlin.any import org.mockito.kotlin.mock import org.mockito.kotlin.whenever -@RunWith(AndroidJUnit4::class) -internal class ModuleMessagingConfigTest : BaseTest() { +internal class ModuleMessagingConfigTest : BaseUnitTest() { private val customerIOMock: CustomerIOInstance = mock() private val fcmTokenProviderMock: DeviceTokenProvider = mock() diff --git a/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingPushFCMTest.kt b/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingPushFCMTest.kt index c01444a75..d6f0e72f2 100644 --- a/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingPushFCMTest.kt +++ b/messagingpush/src/test/java/io/customer/messagingpush/ModuleMessagingPushFCMTest.kt @@ -1,13 +1,11 @@ package io.customer.messagingpush -import androidx.test.ext.junit.runners.AndroidJUnit4 -import io.customer.commontest.BaseTest +import io.customer.commontest.BaseUnitTest import io.customer.sdk.CustomerIOInstance import io.customer.sdk.device.DeviceTokenProvider import io.customer.sdk.extensions.random import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith import org.mockito.kotlin.any import org.mockito.kotlin.anyOrNull import org.mockito.kotlin.mock @@ -15,8 +13,7 @@ import org.mockito.kotlin.never import org.mockito.kotlin.verify import org.mockito.kotlin.whenever -@RunWith(AndroidJUnit4::class) -internal class ModuleMessagingPushFCMTest : BaseTest() { +internal class ModuleMessagingPushFCMTest : BaseUnitTest() { private val customerIOMock: CustomerIOInstance = mock() private val fcmTokenProviderMock: DeviceTokenProvider = mock() @@ -27,7 +24,10 @@ internal class ModuleMessagingPushFCMTest : BaseTest() { super.setup() di.overrideDependency(DeviceTokenProvider::class.java, fcmTokenProviderMock) - di.overrideDependency(MessagingPushModuleConfig::class.java, MessagingPushModuleConfig.default()) + di.overrideDependency( + MessagingPushModuleConfig::class.java, + MessagingPushModuleConfig.default() + ) module = ModuleMessagingPushFCM(overrideCustomerIO = customerIOMock, overrideDiGraph = di) }