Skip to content

Commit d695599

Browse files
committed
fix unit tests
1 parent db6e669 commit d695599

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

core/src/test/kotlin/com/segment/analytics/kotlin/core/AnalyticsTests.kt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,29 +1122,29 @@ class AsyncAnalyticsTests {
11221122
assertEquals(expectedGroupId, e.groupId)
11231123
}
11241124
}
1125-
//
1126-
// @Test
1127-
// fun `startup queue should replay with alias enrichment closure`() {
1128-
// val expected = "bar"
1129-
//
1130-
// analytics.add(afterPlugin)
1131-
// analytics.alias(expected) {
1132-
// it?.anonymousId = "test"
1133-
// it
1134-
// }
1135-
//
1136-
// // now we have tracked event, i.e. event added to startup queue
1137-
// // release the semaphore put on http client, so we startup queue will replay the events
1138-
// httpSemaphore.release()
1139-
// // now we need to wait for events being fully replayed before making assertions
1140-
// assertSemaphore.acquire()
1141-
//
1142-
// assertTrue(actual.isCaptured)
1143-
// actual.captured.let {
1144-
// assertTrue(it is AliasEvent)
1145-
// val e = it as AliasEvent
1146-
// assertEquals(expected, e.userId)
1147-
// assertEquals("test", e.anonymousId)
1148-
// }
1149-
// }
1125+
1126+
@Test
1127+
fun `startup queue should replay with alias enrichment closure`() {
1128+
val expected = "bar"
1129+
1130+
analytics.add(afterPlugin)
1131+
analytics.alias(expected) {
1132+
it?.anonymousId = "test"
1133+
it
1134+
}
1135+
1136+
// now we have tracked event, i.e. event added to startup queue
1137+
// release the semaphore put on http client, so we startup queue will replay the events
1138+
httpSemaphore.release()
1139+
// now we need to wait for events being fully replayed before making assertions
1140+
assertSemaphore.acquire()
1141+
1142+
assertTrue(actual.isCaptured)
1143+
actual.captured.let {
1144+
assertTrue(it is AliasEvent)
1145+
val e = it as AliasEvent
1146+
assertEquals(expected, e.userId)
1147+
assertEquals("test", e.anonymousId)
1148+
}
1149+
}
11501150
}

0 commit comments

Comments
 (0)