@@ -25,17 +25,20 @@ public class IntegrationTestContextFixture : IAsyncLifetime
2525
2626 public readonly LambdaHelper LambdaHelper ;
2727 public readonly CloudWatchHelper CloudWatchHelper ;
28+ public readonly S3Helper S3HelperInstance ;
2829 public readonly HttpClient HttpClient ;
2930
3031 public string RestApiUrlPrefix ;
3132 public string HttpApiUrlPrefix ;
3233 public string TestQueueARN ;
34+ public string TestS3BucketName ;
3335 public List < LambdaFunction > LambdaFunctions ;
3436
3537 public IntegrationTestContextFixture ( )
3638 {
3739 _cloudFormationHelper = new CloudFormationHelper ( new AmazonCloudFormationClient ( Amazon . RegionEndpoint . USWest2 ) ) ;
3840 _s3Helper = new S3Helper ( new AmazonS3Client ( Amazon . RegionEndpoint . USWest2 ) ) ;
41+ S3HelperInstance = _s3Helper ;
3942 LambdaHelper = new LambdaHelper ( new AmazonLambdaClient ( Amazon . RegionEndpoint . USWest2 ) ) ;
4043 CloudWatchHelper = new CloudWatchHelper ( new AmazonCloudWatchLogsClient ( Amazon . RegionEndpoint . USWest2 ) ) ;
4144 HttpClient = new HttpClient ( ) ;
@@ -77,11 +80,17 @@ public async Task InitializeAsync()
7780 Console . WriteLine ( $ "[IntegrationTest] TestQueue URL: { queueUrl } ") ;
7881 Assert . False ( string . IsNullOrEmpty ( queueUrl ) , $ "CloudFormation resource 'TestQueue' was not found in stack '{ _stackName } '.") ;
7982 TestQueueARN = ConvertSqsUrlToArn ( queueUrl ) ;
83+
84+ // Get the S3 bucket name from the physical resource ID
85+ TestS3BucketName = await _cloudFormationHelper . GetResourcePhysicalIdAsync ( _stackName , "TestS3Bucket" ) ;
86+ Console . WriteLine ( $ "[IntegrationTest] TestS3Bucket: { TestS3BucketName } ") ;
87+ Assert . False ( string . IsNullOrEmpty ( TestS3BucketName ) , $ "CloudFormation resource 'TestS3Bucket' was not found in stack '{ _stackName } '.") ;
88+
8089 LambdaFunctions = await LambdaHelper . FilterByCloudFormationStackAsync ( _stackName ) ;
8190 Console . WriteLine ( $ "[IntegrationTest] Found { LambdaFunctions . Count } Lambda functions: { string . Join ( ", " , LambdaFunctions . Select ( f => f . Name ?? "(null)" ) ) } ") ;
8291
8392 Assert . True ( await _s3Helper . BucketExistsAsync ( _bucketName ) , $ "S3 bucket { _bucketName } should exist") ;
84- Assert . Equal ( 36 , LambdaFunctions . Count ) ;
93+ Assert . Equal ( 37 , LambdaFunctions . Count ) ;
8594 Assert . False ( string . IsNullOrEmpty ( RestApiUrlPrefix ) , "RestApiUrlPrefix should not be empty" ) ;
8695 Assert . False ( string . IsNullOrEmpty ( HttpApiUrlPrefix ) , "HttpApiUrlPrefix should not be empty" ) ;
8796
0 commit comments