Skip to content

Commit

Permalink
chore(git): followup changes from main and dev branches
Browse files Browse the repository at this point in the history
Co-authored-by: LordAndras <[email protected]>
Co-authored-by: matusekma <[email protected]>
  • Loading branch information
3 people committed Feb 3, 2025
1 parent af31947 commit 93387c1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class FakeFirebaseDependencyContainer(
override val appLifecycleObserver: AppLifecycleObserver = mockk(relaxed = true),
override val requestModelHelper: RequestModelHelper = mockk(relaxed = true),
override val sessionIdHolder: SessionIdHolder = mockk(relaxed = true),
override val coreCompletionHandlerRefreshTokenProxyProvider: CoreCompletionHandlerRefreshTokenProxyProvider = mockk(relaxed = true),
override val mobileEngageRequestModelFactory: MobileEngageRequestModelFactory = mockk(relaxed = true),
override val mobileEngageSession: MobileEngageSession = mockk(relaxed = true),
override val activityLifecycleWatchdog: ActivityLifecycleWatchdog = mockk(relaxed = true),
Expand Down Expand Up @@ -154,5 +153,5 @@ class FakeFirebaseDependencyContainer(
override val jsOnAppEventListener: OnAppEventListener = mockk(relaxed = true),
override val remoteMessageMapperFactory: RemoteMessageMapperFactory = mockk(relaxed = true),
override val transitionSafeCurrentActivityWatchdog: TransitionSafeCurrentActivityWatchdog = mockk(relaxed = true),
override val sharedPreferencesV3: SharedPreferences = mockk(relaxed = true),
override val sharedPreferencesV3: SharedPreferences = mockk(relaxed = true)
) : MobileEngageComponent
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import org.junit.Before
import org.junit.Test
import java.util.concurrent.CountDownLatch

class DefaultConfigInternalTest {
class DefaultConfigInternalTest {
private companion object {
const val APPLICATION_CODE = "applicationCode"
const val MERCHANT_ID = "merchantId"
Expand Down Expand Up @@ -557,7 +557,7 @@ class DefaultConfigInternalTest {
configInternal.changeMerchantId(MERCHANT_ID, null)

FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe true
verify(mockPredictRequestContext).merchantId = MERCHANT_ID
verify { mockPredictRequestContext.merchantId = MERCHANT_ID }
}

@Test
Expand All @@ -567,19 +567,19 @@ class DefaultConfigInternalTest {
configInternal.changeMerchantId(MERCHANT_ID, null)

FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe true
verify(mockPredictRequestContext).merchantId = MERCHANT_ID
verify(mockPredictInternal).clearPredictOnlyContact(null)
verifyNoInteractions(mockMobileEngageInternal)
verify { mockPredictRequestContext.merchantId = MERCHANT_ID }
verify { mockPredictInternal.clearPredictOnlyContact(null) }
confirmVerified(mockMobileEngageInternal)
}

@Test
fun testChangeMerchantId_whenMobileEngageDisabled_andPredictDisabled_shouldEnablePredict_andShouldNotClearContact() {
configInternal.changeMerchantId(MERCHANT_ID, null)

FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe true
verify(mockPredictRequestContext).merchantId = MERCHANT_ID
verifyNoInteractions(mockPredictInternal)
verifyNoInteractions(mockMobileEngageInternal)
verify { mockPredictRequestContext.merchantId = MERCHANT_ID }
confirmVerified(mockPredictInternal)
confirmVerified(mockMobileEngageInternal)
}

@Test
Expand All @@ -592,7 +592,7 @@ class DefaultConfigInternalTest {
latch.await()

FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe true
verify(mockMobileEngageInternal).clearContact(null)
verify { mockMobileEngageInternal.clearContact(null) }
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import com.emarsys.core.request.model.RequestModel
import com.emarsys.mobileengage.MobileEngageRequestContext
import com.emarsys.mobileengage.util.RequestModelHelper
import com.emarsys.predict.request.PredictRequestContext
import com.emarsys.testUtil.AnnotationSpec
import io.kotest.matchers.shouldBe
import org.junit.Before
import org.junit.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.stub

class MerchantIdHeaderMapperTest : AnnotationSpec() {
class MerchantIdHeaderMapperTest {

private companion object {
const val TIMESTAMP = 123456789L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import com.emarsys.mobileengage.request.MobileEngageRequestModelFactory
import com.emarsys.mobileengage.responsehandler.MobileEngageTokenResponseHandler
import com.emarsys.mobileengage.util.RequestModelHelper
import com.emarsys.predict.request.PredictMultiIdRequestModelFactory
import com.emarsys.testUtil.AnnotationSpec
import com.emarsys.testUtil.mockito.whenever
import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import com.emarsys.mobileengage.request.MobileEngageRequestModelFactory
import com.emarsys.mobileengage.responsehandler.MobileEngageTokenResponseHandler
import com.emarsys.mobileengage.util.RequestModelHelper
import com.emarsys.predict.request.PredictMultiIdRequestModelFactory
import com.emarsys.testUtil.AnnotationSpec
import com.emarsys.testUtil.mockito.whenever
import org.junit.Before
import org.junit.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.eq
Expand All @@ -23,7 +24,7 @@ import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import java.net.URL

class CoreCompletionHandlerRefreshTokenProxyTest : AnnotationSpec() {
class CoreCompletionHandlerRefreshTokenProxyTest {


companion object {
Expand Down

0 comments on commit 93387c1

Please sign in to comment.