Skip to content

Commit

Permalink
fix(setup): call clearContact in setup instead of setContact with nulls
Browse files Browse the repository at this point in the history
SUITEDEV-36785

Co-authored-by: LasOri <[email protected]>
Co-authored-by: megamegax <[email protected]>
Co-authored-by: matusekma <[email protected]>
  • Loading branch information
4 people committed Oct 15, 2024
1 parent e66f83d commit f163302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions emarsys-sdk/src/androidTest/java/com/emarsys/EmarsysTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ class EmarsysTest : AnnotationSpec() {
}

@Test
fun testSetup_sendAnonymousContact() {
fun testSetup_shouldSetAnonymousContact_withClearContactCall() {
every { mockContactTokenStorage.get() } returns null
every { mockRequestContext.hasContactIdentification() } returns false
every { mockClientStateStorage.get() } returns null
Expand All @@ -596,7 +596,7 @@ class EmarsysTest : AnnotationSpec() {
setup(mobileEngageConfig)

runBlockingOnCoreSdkThread()
verify { mockMobileEngageApi.setContact(null, null, null) }
verify { mockMobileEngageApi.clearContact(null) }
}

@Test
Expand All @@ -613,7 +613,7 @@ class EmarsysTest : AnnotationSpec() {

verifyOrder {
mockClientServiceApi.trackDeviceInfo(null)
mockMobileEngageApi.setContact(null, null, null)
mockMobileEngageApi.clearContact(null)
}
confirmVerified(mockMobileEngageApi, mockClientServiceApi)
}
Expand Down
2 changes: 1 addition & 1 deletion emarsys-sdk/src/main/java/com/emarsys/Emarsys.kt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ object Emarsys {
}
EmarsysDependencyInjection.mobileEngageApi()
.proxyWithLogExceptions()
.setContact()
.clearContact(null)
}
}

Expand Down

0 comments on commit f163302

Please sign in to comment.