Skip to content

.NET Amazon.Lambda.TestUtilities test requests fail with 404 when the API route has a hyphen #1342

@will-kienle-bayer

Description

@will-kienle-bayer

Describe the bug

I have a .NET 6.0 Lambda API. I am running unit tests over the controller classes using the APIGatewayProxyFunction, APIGatewayProxyRequest, and TestLambdaContext classes to simulate an HTTP request to the lambda resource. I've discovered that when the API endpoint route contains a hyphen, these simulated requests return a status code of 404, causing the tests to fail. However, this failure only occurs when running in our Github action. This behavior is not observed on my development machine, so there must be some configuration/environment that affects it. Further, the actual API itself works, both locally and when deployed to an actual lambda function. If I run the exact same test, but simply remove the hyphen from the API route and the request, the request succeeds.

Expected Behavior

Test API instance returns a response

Current Behavior

Test API instance returns 404

Reproduction Steps

code.txt

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon.Lambda.Core 2.1.0
Amazon.Lambda.APIGatewayEvents 2.5.0
Amazon.Lambda.TestUtilities 2.0.0
AWSSDK.Core 3.7.13.14
AWSSDK.Extensions.NETCore.Setup 3.7.2

Targeted .NET Platform

.NET 6.0

Operating System and version

Development machine is win10, github action runner is undetermined Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions