Skip to content

Commit

Permalink
fixed messagingpush tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Sep 15, 2023
1 parent 78d0fd1 commit 05e3a23
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<String, CustomerIOModule<*>>()
private val customerIOMock: CustomerIOInstance = mock()
private val trackRepositoryMock: TrackRepository = mock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
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
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()
Expand All @@ -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)
}
Expand Down

0 comments on commit 05e3a23

Please sign in to comment.