diff --git a/emarsys-sdk/src/androidTest/java/com/emarsys/EmarsysTest.kt b/emarsys-sdk/src/androidTest/java/com/emarsys/EmarsysTest.kt index 32cd213f..91898ee0 100644 --- a/emarsys-sdk/src/androidTest/java/com/emarsys/EmarsysTest.kt +++ b/emarsys-sdk/src/androidTest/java/com/emarsys/EmarsysTest.kt @@ -694,7 +694,7 @@ class EmarsysTest : AnnotationSpec() { } @Test - fun testSetAuthenticatedContactWithCompletionListener_doNotDelegatesToMobileEngageApi_whenMobileEngageDisabled() { + fun testSetAuthenticatedContactWithCompletionListener_doNotDelegatesToMobileEngageApi_whenMobileEngageDisabled_andPredictIsEnabled() { setup(predictConfig) setAuthenticatedContact(CONTACT_FIELD_ID, OPEN_ID_TOKEN, completionListener) @@ -719,16 +719,24 @@ class EmarsysTest : AnnotationSpec() { OPEN_ID_TOKEN, completionListener ) - FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe false + FeatureRegistry.isFeatureEnabled(InnerFeature.PREDICT) shouldBe true verifyNoInteractions(mockPredictRestricted) } @Test - fun testSetAuthenticatedContactWithCompletionListener_doNotDelegatesToMobileEngageApi_whenMobileEngageAndPredictDisabled() { + fun testSetAuthenticatedContactWithCompletionListener_delegatesToLoggingMobileEngageApi_whenMobileEngageAndPredictDisabled() { setup(baseConfig) setAuthenticatedContact(CONTACT_FIELD_ID, OPEN_ID_TOKEN, completionListener) + runBlockingOnCoreSdkThread() + + verify(mockLoggingMobileEngageApi).setAuthenticatedContact( + CONTACT_FIELD_ID, + OPEN_ID_TOKEN, + completionListener + ) + runBlockingOnCoreSdkThread { verifyNoInteractions(mockPredictRestricted) setAuthenticatedContact(CONTACT_FIELD_ID, OPEN_ID_TOKEN, completionListener) diff --git a/emarsys-sdk/src/main/java/com/emarsys/Emarsys.kt b/emarsys-sdk/src/main/java/com/emarsys/Emarsys.kt index a2d67215..a20d7969 100644 --- a/emarsys-sdk/src/main/java/com/emarsys/Emarsys.kt +++ b/emarsys-sdk/src/main/java/com/emarsys/Emarsys.kt @@ -121,8 +121,6 @@ object Emarsys { .proxyApi(mobileEngage().concurrentHandlerHolder) .setAuthenticatedContact(contactFieldId, openIdToken, completionListener) } - - FeatureRegistry.disableFeature(PREDICT) } @JvmStatic