@@ -1056,41 +1056,41 @@ class AsyncAnalyticsTests {
1056
1056
assertEquals(expectedAnonymousId, e.anonymousId)
1057
1057
}
1058
1058
}
1059
- //
1060
- // @Test
1061
- // fun `startup queue should replay with identify enrichment closure`() {
1062
- // val expected = buildJsonObject {
1063
- // put("foo", "baz")
1064
- // }
1065
- // val expectedUserId = "newUserId"
1066
- //
1067
- // analytics.add(afterPlugin)
1068
- // analytics.identify(expectedUserId) {
1069
- // if (it is IdentifyEvent) {
1070
- // it.traits = updateJsonObject(it.traits) {
1071
- // it["foo"] = "baz"
1072
- // }
1073
- // }
1074
- // it
1075
- // }
1076
- //
1077
- // // now we have tracked event, i.e. event added to startup queue
1078
- // // release the semaphore put on http client, so we startup queue will replay the events
1079
- // httpSemaphore.release()
1080
- // // now we need to wait for events being fully replayed before making assertions
1081
- // assertSemaphore.acquire()
1082
- //
1083
- // val actualUserId = analytics.userId()
1084
- //
1085
- // assertTrue(actual.isCaptured)
1086
- // actual.captured.let {
1087
- // assertTrue(it is IdentifyEvent)
1088
- // val e = it as IdentifyEvent
1089
- // assertEquals(expected, e.traits)
1090
- // assertEquals(expectedUserId, actualUserId)
1091
- // }
1092
- // }
1093
- //
1059
+
1060
+ @Test
1061
+ fun `startup queue should replay with identify enrichment closure` () {
1062
+ val expected = buildJsonObject {
1063
+ put(" foo" , " baz" )
1064
+ }
1065
+ val expectedUserId = " newUserId"
1066
+
1067
+ analytics.add(afterPlugin)
1068
+ analytics.identify(expectedUserId) {
1069
+ if (it is IdentifyEvent ) {
1070
+ it.traits = updateJsonObject(it.traits) {
1071
+ it[" foo" ] = " baz"
1072
+ }
1073
+ }
1074
+ it
1075
+ }
1076
+
1077
+ // now we have tracked event, i.e. event added to startup queue
1078
+ // release the semaphore put on http client, so we startup queue will replay the events
1079
+ httpSemaphore.release()
1080
+ // now we need to wait for events being fully replayed before making assertions
1081
+ assertSemaphore.acquire()
1082
+
1083
+ val actualUserId = analytics.userId()
1084
+
1085
+ assertTrue(actual.isCaptured)
1086
+ actual.captured.let {
1087
+ assertTrue(it is IdentifyEvent )
1088
+ val e = it as IdentifyEvent
1089
+ assertEquals(expected, e.traits)
1090
+ assertEquals(expectedUserId, actualUserId)
1091
+ }
1092
+ }
1093
+
1094
1094
// @Test
1095
1095
// fun `startup queue should replay with group enrichment closure`() {
1096
1096
// val expected = buildJsonObject {
0 commit comments