@@ -152,6 +152,8 @@ func fixture(name string) string {
152
152
return string (b )
153
153
}
154
154
155
+ func mockId () string { return "I'm unique" }
156
+
155
157
func mockTime () time.Time {
156
158
// time.Unix(0, 0) fails on Circle
157
159
return time .Date (2009 , time .November , 10 , 23 , 0 , 0 , 0 , time .UTC )
@@ -189,11 +191,11 @@ func ExampleCapture() {
189
191
Endpoint : server .URL ,
190
192
BatchSize : 1 ,
191
193
now : mockTime ,
194
+ uid : mockId ,
192
195
})
193
196
defer client .Close ()
194
197
195
198
client .Enqueue (Capture {
196
- Uuid : "00000000-0000-0000-0000-000000000000" ,
197
199
Event : "Download" ,
198
200
DistinctId : "123456" ,
199
201
Properties : Properties {
@@ -223,8 +225,7 @@ func ExampleCapture() {
223
225
// },
224
226
// "send_feature_flags": false,
225
227
// "timestamp": "2009-11-10T23:00:00Z",
226
- // "type": "capture",
227
- // "uuid": "00000000-0000-0000-0000-000000000000"
228
+ // "type": "capture"
228
229
// }
229
230
// ]
230
231
// }
@@ -245,6 +246,7 @@ func TestCaptureNoProperties(t *testing.T) {
245
246
Endpoint : server .URL ,
246
247
BatchSize : 1 ,
247
248
now : mockTime ,
249
+ uid : mockId ,
248
250
DefaultEventProperties : NewProperties ().Set ("service" , "api" ),
249
251
})
250
252
defer client .Close ()
@@ -321,9 +323,8 @@ func TestEnqueue(t *testing.T) {
321
323
},
322
324
323
325
"*capture" : {
324
- strings .TrimSpace (fixture ("test-enqueue-capture-with-uuid .json" )),
326
+ strings .TrimSpace (fixture ("test-enqueue-capture.json" )),
325
327
& Capture {
326
- Uuid : "11111111-1111-1111-1111-111111111111" ,
327
328
Event : "Download" ,
328
329
DistinctId : "123456" ,
329
330
Properties : Properties {
@@ -345,6 +346,7 @@ func TestEnqueue(t *testing.T) {
345
346
Logger : t ,
346
347
BatchSize : 1 ,
347
348
now : mockTime ,
349
+ uid : mockId ,
348
350
})
349
351
defer client .Close ()
350
352
@@ -402,6 +404,7 @@ func TestCaptureWithInterval(t *testing.T) {
402
404
Verbose : true ,
403
405
Logger : t ,
404
406
now : mockTime ,
407
+ uid : mockId ,
405
408
})
406
409
defer client .Close ()
407
410
@@ -438,6 +441,7 @@ func TestCaptureWithTimestamp(t *testing.T) {
438
441
Logger : t ,
439
442
BatchSize : 1 ,
440
443
now : mockTime ,
444
+ uid : mockId ,
441
445
})
442
446
defer client .Close ()
443
447
@@ -471,6 +475,7 @@ func TestCaptureWithDefaultProperties(t *testing.T) {
471
475
Logger : t ,
472
476
BatchSize : 1 ,
473
477
now : mockTime ,
478
+ uid : mockId ,
474
479
})
475
480
defer client .Close ()
476
481
@@ -503,6 +508,7 @@ func TestCaptureMany(t *testing.T) {
503
508
Logger : t ,
504
509
BatchSize : 3 ,
505
510
now : mockTime ,
511
+ uid : mockId ,
506
512
})
507
513
defer client .Close ()
508
514
@@ -1705,6 +1711,7 @@ func TestCaptureSendFlags(t *testing.T) {
1705
1711
Logger : t ,
1706
1712
BatchSize : 1 ,
1707
1713
now : mockTime ,
1714
+ uid : mockId ,
1708
1715
1709
1716
PersonalApiKey : "some very secret key" ,
1710
1717
})
0 commit comments