@@ -284,18 +284,25 @@ describe('InstrumentationPatchTest', () => {
284284 ListDataSources : { 'aws.bedrock.knowledge_base.id' : _BEDROCK_KNOWLEDGEBASE_ID } ,
285285 UpdateAgentKnowledgeBase : { 'aws.bedrock.knowledge_base.id' : _BEDROCK_KNOWLEDGEBASE_ID } ,
286286 DeleteDataSource : { 'aws.bedrock.data_source.id' : _BEDROCK_DATASOURCE_ID } ,
287- GetDataSource : { 'aws.bedrock.data_source.id' : _BEDROCK_DATASOURCE_ID } ,
287+ GetDataSource : {
288+ 'aws.bedrock.data_source.id' : _BEDROCK_DATASOURCE_ID ,
289+ 'aws.bedrock.knowledge_base.id' : _BEDROCK_KNOWLEDGEBASE_ID ,
290+ } ,
288291 UpdateDataSource : { 'aws.bedrock.data_source.id' : _BEDROCK_DATASOURCE_ID } ,
289292 } ;
290293
291294 for ( const [ operation , attribute_tuple ] of Object . entries ( operation_to_expected_attribute ) ) {
292295 const bedrockAttributes : Attributes = doExtractBedrockAttributes ( services , 'BedrockAgent' , operation ) ;
293- const [ attribute_key , attribute_value ] = Object . entries ( attribute_tuple ) [ 0 ] ;
294- expect ( Object . entries ( bedrockAttributes ) . length ) . toBe ( 1 ) ;
295- expect ( bedrockAttributes [ attribute_key ] ) . toEqual ( attribute_value ) ;
296+
297+ for ( const [ attribute_key , attribute_value ] of Object . entries ( attribute_tuple ) ) {
298+ expect ( bedrockAttributes [ attribute_key ] ) . toEqual ( attribute_value ) ;
299+ }
300+
296301 const bedrockAgentSuccessAttributes : Attributes = doResponseHookBedrock ( services , 'BedrockAgent' , operation ) ;
297- expect ( Object . entries ( bedrockAgentSuccessAttributes ) . length ) . toBe ( 1 ) ;
298- expect ( bedrockAgentSuccessAttributes [ attribute_key ] ) . toEqual ( attribute_value ) ;
302+
303+ for ( const [ attribute_key , attribute_value ] of Object . entries ( attribute_tuple ) ) {
304+ expect ( bedrockAgentSuccessAttributes [ attribute_key ] ) . toEqual ( attribute_value ) ;
305+ }
299306 }
300307 } ) ;
301308
0 commit comments