Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maureenorea-clores committed Apr 1, 2024
1 parent 86ecdb4 commit c644b30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.rakuten.tech.mobile.inappmessaging.runtime
import java.util.Locale

object InAppMessagingTestConstants {
const val APP_ID = "com.rakuten.test"
const val APP_ID = "rakuten.com.tech.mobile.test"
val LOCALE = Locale.getDefault()
const val APP_VERSION = "0.0.1"
const val CONFIG_URL = "https://config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.work.ListenableWorker
import androidx.work.WorkerParameters
import com.rakuten.tech.mobile.inappmessaging.runtime.InApp.AppManifestConfig
import com.rakuten.tech.mobile.inappmessaging.runtime.InAppMessaging
import com.rakuten.tech.mobile.inappmessaging.runtime.InAppMessagingTestConstants
import com.rakuten.tech.mobile.inappmessaging.runtime.UserInfoProvider
import com.rakuten.tech.mobile.inappmessaging.runtime.data.models.HostAppInfo
import com.rakuten.tech.mobile.inappmessaging.runtime.data.repositories.ConfigResponseRepository
Expand Down Expand Up @@ -94,7 +95,7 @@ class IntegrationSpec {
HostAppInfoRepository.instance().apply {
addHostInfo(
HostAppInfo(
packageName = "rakuten.com.tech.mobile.test",
packageName = InAppMessagingTestConstants.APP_ID,
deviceId = this.getDeviceId(),
version = this.getVersion(),
subscriptionKey = this.getSubscriptionKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ open class ConfigWorkerSpec : BaseTest() {

internal fun initializeInstance() {
val testAppInfo = HostAppInfo(
"rakuten.com.tech.mobile.test",
InAppMessagingTestConstants.APP_ID,
InAppMessagingTestConstants.DEVICE_ID, InAppMessagingTestConstants.APP_VERSION,
"test-key", InAppMessagingTestConstants.LOCALE,
)
Expand Down Expand Up @@ -110,7 +110,6 @@ class ConfigWorkerSuccessSpec : ConfigWorkerSpec() {
val ctx = ApplicationProvider.getApplicationContext<Context>()
val app = ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)
val bundle = app.metaData
`when`(mockHostRepo.getPackageName()).thenReturn(ctx.packageName)
val version = ctx.packageManager.getPackageInfo(ctx.packageName, 0).versionName
`when`(mockHostRepo.getVersion()).thenReturn(version)
`when`(mockHostRepo.getConfigUrl()).thenReturn(bundle.getString(CONFIG_KEY, ""))
Expand Down

0 comments on commit c644b30

Please sign in to comment.