Skip to content

Commit

Permalink
Fix TestSignerScope UnitTest to pass after removing endpoints.json
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-othman authored and boblodgett committed Jun 3, 2024
1 parent b5afae9 commit 45f8118
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/test/UnitTests/Custom/Runtime/SignerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public void TestSignerWithMutableHeader()
// Real region with credentialScope.region
new object[]{new AmazonECRConfig { RegionEndpoint = RegionEndpoint.GetBySystemName("us-east-1") },
"us-east-1", "ecr", "api.ecr.us-east-1.amazonaws.com" },
// Pseudoregion with credentialScope.region
new object[]{ new AmazonECRConfig { RegionEndpoint = RegionEndpoint.GetBySystemName("fips-dkr-us-east-1") },
"us-east-1", "ecr", "ecr-fips.us-east-1.amazonaws.com"},
// Pseudoregion with credentialScope.region, different partition
new object[]{ new AmazonECRConfig { RegionEndpoint = RegionEndpoint.GetBySystemName("fips-us-gov-east-1") },
"us-gov-east-1", "ecr", "ecr-fips.us-gov-east-1.amazonaws.com" },
Expand Down Expand Up @@ -111,9 +108,11 @@ public void TestSignerScope(IClientConfig config, string expectedAuthRegion, str
{
var signer = new AWS4Signer();
var mock = new Moq.Mock<IRequest>().SetupAllProperties();
var requestMock = new Moq.Mock<AmazonWebServiceRequest>().SetupAllProperties();
var request = mock.Object;

mock.SetupGet(x => x.Headers).Returns(new Dictionary<string, string>());
mock.SetupGet(x => x.OriginalRequest).Returns(requestMock.Object);
request.Endpoint = EndpointResolver.DetermineEndpoint(config, request);

var result = signer.SignRequest(request, config, null, "accessKey", "secretKey");
Expand Down

0 comments on commit 45f8118

Please sign in to comment.