@@ -168,13 +168,14 @@ describe('Tracer integration tests', () => {
168168 // Assert that the subsegment name is the expected one
169169 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
170170 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 ) ;
173173
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
176176 expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
177177 expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
178+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
178179
179180 const { annotations, metadata } = handlerSubsegment ;
180181
@@ -239,12 +240,13 @@ describe('Tracer integration tests', () => {
239240 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
240241 if ( handlerSubsegment ?. subsegments !== undefined ) {
241242 // Assert that there're two subsegments
242- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
243+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
243244
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
246247 expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
247248 expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
249+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
248250
249251 const { annotations, metadata } = handlerSubsegment ;
250252
@@ -309,12 +311,13 @@ describe('Tracer integration tests', () => {
309311 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
310312 if ( handlerSubsegment ?. subsegments !== undefined ) {
311313 // Assert that there're two subsegments
312- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
314+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
313315
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
316318 expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
317319 expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
320+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
318321
319322 const { annotations, metadata } = handlerSubsegment ;
320323
@@ -401,18 +404,21 @@ describe('Tracer integration tests', () => {
401404 // Assert that the subsegment name is the expected one
402405 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
403406 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 ) ;
406409
407410 // Sort the subsegments by name
408411 const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
409412 const methodSubsegment : ParsedDocument [ ] = [ ] ;
413+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
410414 const otherSegments : ParsedDocument [ ] = [ ] ;
411415 handlerSubsegment ?. subsegments . forEach ( subsegment => {
412416 if ( subsegment . name === 'DynamoDB' ) {
413417 dynamoDBSubsegments . push ( subsegment ) ;
414418 } else if ( subsegment . name === '### myMethod' ) {
415419 methodSubsegment . push ( subsegment ) ;
420+ } else if ( subsegment . name === 'httpbin.org' ) {
421+ httpSubsegment . push ( subsegment ) ;
416422 } else {
417423 otherSegments . push ( subsegment ) ;
418424 }
@@ -421,6 +427,8 @@ describe('Tracer integration tests', () => {
421427 expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
422428 // Assert that there is exactly one subsegment with the name '### myMethod'
423429 expect ( methodSubsegment . length ) . toBe ( 1 ) ;
430+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
431+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
424432 // Assert that there are exactly zero other subsegments
425433 expect ( otherSegments . length ) . toBe ( 0 ) ;
426434
@@ -498,18 +506,21 @@ describe('Tracer integration tests', () => {
498506 // Assert that the subsegment name is the expected one
499507 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
500508 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 ) ;
503511
504512 // Sort the subsegments by name
505513 const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
506514 const methodSubsegment : ParsedDocument [ ] = [ ] ;
515+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
507516 const otherSegments : ParsedDocument [ ] = [ ] ;
508517 handlerSubsegment ?. subsegments . forEach ( subsegment => {
509518 if ( subsegment . name === 'DynamoDB' ) {
510519 dynamoDBSubsegments . push ( subsegment ) ;
511520 } else if ( subsegment . name === '### myMethod' ) {
512521 methodSubsegment . push ( subsegment ) ;
522+ } else if ( subsegment . name === 'httpbin.org' ) {
523+ httpSubsegment . push ( subsegment ) ;
513524 } else {
514525 otherSegments . push ( subsegment ) ;
515526 }
@@ -518,6 +529,8 @@ describe('Tracer integration tests', () => {
518529 expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
519530 // Assert that there is exactly one subsegment with the name '### myMethod'
520531 expect ( methodSubsegment . length ) . toBe ( 1 ) ;
532+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
533+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
521534 // Assert that there are exactly zero other subsegments
522535 expect ( otherSegments . length ) . toBe ( 0 ) ;
523536
@@ -595,18 +608,21 @@ describe('Tracer integration tests', () => {
595608 // Assert that the subsegment name is the expected one
596609 expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
597610 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 ) ;
600613
601614 // Sort the subsegments by name
602615 const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
603616 const methodSubsegment : ParsedDocument [ ] = [ ] ;
617+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
604618 const otherSegments : ParsedDocument [ ] = [ ] ;
605619 handlerSubsegment ?. subsegments . forEach ( subsegment => {
606620 if ( subsegment . name === 'DynamoDB' ) {
607621 dynamoDBSubsegments . push ( subsegment ) ;
608622 } else if ( subsegment . name === '### myMethod' ) {
609623 methodSubsegment . push ( subsegment ) ;
624+ } else if ( subsegment . name === 'httpbin.org' ) {
625+ httpSubsegment . push ( subsegment ) ;
610626 } else {
611627 otherSegments . push ( subsegment ) ;
612628 }
@@ -615,6 +631,8 @@ describe('Tracer integration tests', () => {
615631 expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
616632 // Assert that there is exactly one subsegment with the name '### myMethod'
617633 expect ( methodSubsegment . length ) . toBe ( 1 ) ;
634+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
635+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
618636 // Assert that there are exactly zero other subsegments
619637 expect ( otherSegments . length ) . toBe ( 0 ) ;
620638 // Assert that no response was captured on the subsegment
0 commit comments