From ac9f0873d96d31c44beb8eefeccc52b9d930bf4e Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Wed, 18 Dec 2024 01:38:34 -0500 Subject: [PATCH] rename json inference tests --- .../Extensions/ApiGatewayResponseExtensions.cs | 2 ++ .../ApiGatewayResponseIntegrationTestFixture.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Extensions/ApiGatewayResponseExtensions.cs b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Extensions/ApiGatewayResponseExtensions.cs index 95fc1f672..e3cd3f768 100644 --- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Extensions/ApiGatewayResponseExtensions.cs +++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Extensions/ApiGatewayResponseExtensions.cs @@ -261,6 +261,8 @@ private static void SetContentTypeAndStatusCodeV2(HttpResponse response, IDictio else { // Assume for now that when status code is not set (we are assuming 0 means not set) then set the default to application/json + // Tehnically if the user were to return statusCode = 0 explicity in the response body, api gateway should internal server error, but since we don't + // have a way to differentiate it and not returning status code is more common, we will do this way for now. // API Gateway 2.0 format version assumptions response.StatusCode = 200; response.ContentType = "application/json"; diff --git a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayResponseIntegrationTestFixture.cs b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayResponseIntegrationTestFixture.cs index 7c2ebf8e2..1f59bf8c6 100644 --- a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayResponseIntegrationTestFixture.cs +++ b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayResponseIntegrationTestFixture.cs @@ -37,7 +37,7 @@ public ApiGatewayResponseIntegrationTestFixture() public async Task InitializeAsync() { - StackName = $"Test-{Guid.NewGuid().ToString("N").Substring(5)}"; + StackName = $"Test-{Guid.NewGuid().ToString("N").Substring(0, 5)}"; string templateBody = ReadCloudFormationTemplate("cloudformation-template-apigateway.yaml"); await CloudFormationHelper.CreateStackAsync(StackName, templateBody);