@@ -168,13 +168,14 @@ describe('Tracer integration tests', () => {
168
168
// Assert that the subsegment name is the expected one
169
169
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
170
170
if ( handlerSubsegment ?. subsegments !== undefined ) {
171
- // Assert that there're two subsegments
172
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
171
+ // Assert that there're three subsegments
172
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
173
173
174
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
175
- // Assert that the subsegment names is the expected ones
174
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
175
+ // Assert that the subsegment names are the expected ones
176
176
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
177
177
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
178
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
178
179
179
180
const { annotations, metadata } = handlerSubsegment ;
180
181
@@ -239,12 +240,13 @@ describe('Tracer integration tests', () => {
239
240
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
240
241
if ( handlerSubsegment ?. subsegments !== undefined ) {
241
242
// Assert that there're two subsegments
242
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
243
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
243
244
244
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
245
- // Assert that the subsegment names is the expected ones
245
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
246
+ // Assert that the subsegment names are the expected ones
246
247
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
247
248
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
249
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
248
250
249
251
const { annotations, metadata } = handlerSubsegment ;
250
252
@@ -309,12 +311,13 @@ describe('Tracer integration tests', () => {
309
311
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
310
312
if ( handlerSubsegment ?. subsegments !== undefined ) {
311
313
// Assert that there're two subsegments
312
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
314
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
313
315
314
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
315
- // Assert that the subsegment names is the expected ones
316
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
317
+ // Assert that the subsegment names are the expected ones
316
318
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
317
319
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
320
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
318
321
319
322
const { annotations, metadata } = handlerSubsegment ;
320
323
@@ -401,18 +404,21 @@ describe('Tracer integration tests', () => {
401
404
// Assert that the subsegment name is the expected one
402
405
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
403
406
if ( handlerSubsegment ?. subsegments !== undefined ) {
404
- // Assert that there're three subsegments
405
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
407
+ // Assert that there're four subsegments
408
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
406
409
407
410
// Sort the subsegments by name
408
411
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
409
412
const methodSubsegment : ParsedDocument [ ] = [ ] ;
413
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
410
414
const otherSegments : ParsedDocument [ ] = [ ] ;
411
415
handlerSubsegment ?. subsegments . forEach ( subsegment => {
412
416
if ( subsegment . name === 'DynamoDB' ) {
413
417
dynamoDBSubsegments . push ( subsegment ) ;
414
418
} else if ( subsegment . name === '### myMethod' ) {
415
419
methodSubsegment . push ( subsegment ) ;
420
+ } else if ( subsegment . name === 'httpbin.org' ) {
421
+ httpSubsegment . push ( subsegment ) ;
416
422
} else {
417
423
otherSegments . push ( subsegment ) ;
418
424
}
@@ -421,6 +427,8 @@ describe('Tracer integration tests', () => {
421
427
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
422
428
// Assert that there is exactly one subsegment with the name '### myMethod'
423
429
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
430
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
431
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
424
432
// Assert that there are exactly zero other subsegments
425
433
expect ( otherSegments . length ) . toBe ( 0 ) ;
426
434
@@ -498,18 +506,21 @@ describe('Tracer integration tests', () => {
498
506
// Assert that the subsegment name is the expected one
499
507
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
500
508
if ( handlerSubsegment ?. subsegments !== undefined ) {
501
- // Assert that there're three subsegments
502
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
509
+ // Assert that there're four subsegments
510
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
503
511
504
512
// Sort the subsegments by name
505
513
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
506
514
const methodSubsegment : ParsedDocument [ ] = [ ] ;
515
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
507
516
const otherSegments : ParsedDocument [ ] = [ ] ;
508
517
handlerSubsegment ?. subsegments . forEach ( subsegment => {
509
518
if ( subsegment . name === 'DynamoDB' ) {
510
519
dynamoDBSubsegments . push ( subsegment ) ;
511
520
} else if ( subsegment . name === '### myMethod' ) {
512
521
methodSubsegment . push ( subsegment ) ;
522
+ } else if ( subsegment . name === 'httpbin.org' ) {
523
+ httpSubsegment . push ( subsegment ) ;
513
524
} else {
514
525
otherSegments . push ( subsegment ) ;
515
526
}
@@ -518,6 +529,8 @@ describe('Tracer integration tests', () => {
518
529
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
519
530
// Assert that there is exactly one subsegment with the name '### myMethod'
520
531
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
532
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
533
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
521
534
// Assert that there are exactly zero other subsegments
522
535
expect ( otherSegments . length ) . toBe ( 0 ) ;
523
536
@@ -595,18 +608,21 @@ describe('Tracer integration tests', () => {
595
608
// Assert that the subsegment name is the expected one
596
609
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
597
610
if ( handlerSubsegment ?. subsegments !== undefined ) {
598
- // Assert that there're three subsegments
599
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
611
+ // Assert that there're four subsegments
612
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
600
613
601
614
// Sort the subsegments by name
602
615
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
603
616
const methodSubsegment : ParsedDocument [ ] = [ ] ;
617
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
604
618
const otherSegments : ParsedDocument [ ] = [ ] ;
605
619
handlerSubsegment ?. subsegments . forEach ( subsegment => {
606
620
if ( subsegment . name === 'DynamoDB' ) {
607
621
dynamoDBSubsegments . push ( subsegment ) ;
608
622
} else if ( subsegment . name === '### myMethod' ) {
609
623
methodSubsegment . push ( subsegment ) ;
624
+ } else if ( subsegment . name === 'httpbin.org' ) {
625
+ httpSubsegment . push ( subsegment ) ;
610
626
} else {
611
627
otherSegments . push ( subsegment ) ;
612
628
}
@@ -615,6 +631,8 @@ describe('Tracer integration tests', () => {
615
631
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
616
632
// Assert that there is exactly one subsegment with the name '### myMethod'
617
633
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
634
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
635
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
618
636
// Assert that there are exactly zero other subsegments
619
637
expect ( otherSegments . length ) . toBe ( 0 ) ;
620
638
// Assert that no response was captured on the subsegment
0 commit comments