Skip to content

Commit

Permalink
test(mobile-engage): improved stability of MobileEngageIntegrationTests
Browse files Browse the repository at this point in the history
SDK-135

Co-authored-by: megamegax <[email protected]>
Co-authored-by: Andras Sarro <[email protected]>
  • Loading branch information
3 people committed Jan 9, 2025
1 parent 0c4933c commit de86279
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testSetContact() {
Emarsys.setContact(
CONTACT_FIELD_ID,
Expand All @@ -146,15 +145,13 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testClearContact() {
Emarsys.clearContact(
this::eventuallyStoreResult
).apply { eventuallyAssertSuccess() }
}

@Test

fun testTrackCustomEvent_V3_noAttributes() {
Emarsys.trackCustomEvent(
"integrationTestCustomEvent",
Expand All @@ -164,7 +161,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testTrackCustomEvent_V3_withAttributes() {
Emarsys.trackCustomEvent(
"integrationTestCustomEvent",
Expand All @@ -174,7 +170,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testTrackInternalCustomEvent_V3_noAttributes() {
val eventServiceInternal = emarsys().eventServiceInternal

Expand All @@ -186,7 +181,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testTrackInternalCustomEvent_V3_withAttributes() {
val eventServiceInternal = emarsys().eventServiceInternal

Expand All @@ -198,7 +192,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testSetPushToken() {
Emarsys.push.setPushToken(
"integration_test_push_token",
Expand All @@ -207,15 +200,13 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testRemovePushToken() {
Emarsys.push.clearPushToken(
this::eventuallyStoreResult
).apply { eventuallyAssertSuccess() }
}

@Test

fun testDeepLinkOpen() {
Thread.sleep(1000)
val activity = mockk<Activity>(relaxed = true)
Expand All @@ -236,7 +227,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testTrackDeviceInfo() {
val clientServiceInternal = emarsys().clientServiceInternal

Expand All @@ -245,7 +235,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testConfig_changeApplicationCode() {
val originalApplicationCode = Emarsys.config.applicationCode
Emarsys.config.changeApplicationCode(OTHER_APP_ID, this::eventuallyStoreResult)
Expand All @@ -255,7 +244,6 @@ class MobileEngageIntegrationTest : AnnotationSpec() {
}

@Test

fun testConfig_changeApplicationCode_nilToSomething() {
val setupLatch = CountDownLatch(1)
emarsys().concurrentHandlerHolder.coreHandler.post {
Expand Down Expand Up @@ -289,6 +277,7 @@ class MobileEngageIntegrationTest : AnnotationSpec() {

private fun eventuallyAssertSuccess() {
completionListenerLatch.await()
completionHandlerLatch?.await()
errorCause shouldBe null
responseModel.statusCode shouldBeInRange IntRange(200, 299)
}
Expand Down

0 comments on commit de86279

Please sign in to comment.