Skip to content

Commit a914986

Browse files
committed
update variable names
1 parent 9ea2aca commit a914986

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Commands/Settings/RunCommandSettings.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ public sealed class RunCommandSettings : CommandSettings
1616
/// The hostname or IP address used for the test tool's web interface.
1717
/// Any host other than an explicit IP address or localhost (e.g. '*', '+' or 'example.com') binds to all public IPv4 and IPv6 addresses.
1818
/// </summary>
19-
[CommandOption("--host <HOST>")]
19+
[CommandOption("--lambda-emulator-host <HOST>")]
2020
[Description(
2121
"The hostname or IP address used for the test tool's web interface. Any host other than an explicit IP address or localhost (e.g. '*', '+' or 'example.com') binds to all public IPv4 and IPv6 addresses.")]
22-
[DefaultValue(Constants.DefaultHost)]
23-
public string Host { get; set; } = Constants.DefaultHost;
22+
[DefaultValue(Constants.DefaultLambdaEmulatorHost)]
23+
public string LambdaEmulatorHost { get; set; } = Constants.DefaultLambdaEmulatorHost;
2424

2525
/// <summary>
2626
/// The port number used for the test tool's web interface.
2727
/// </summary>
28-
[CommandOption("-p|--port <PORT>")]
28+
[CommandOption("-p|--lambda-emulator-port <PORT>")]
2929
[Description("The port number used for the test tool's web interface.")]
30-
[DefaultValue(Constants.DefaultLambdaRuntimeEmulatorPort)]
31-
public int Port { get; set; } = Constants.DefaultLambdaRuntimeEmulatorPort;
30+
[DefaultValue(Constants.DefaultLambdaEmulatorPort)]
31+
public int LambdaEmulatorPort { get; set; } = Constants.DefaultLambdaEmulatorPort;
3232

3333
/// <summary>
3434
/// Disable auto launching the test tool's web interface in a browser.

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public abstract class Constants
1818
/// <summary>
1919
/// The default port used by the Lambda Test Tool for the Lambda Runtime API and the Web Interface.
2020
/// </summary>
21-
public const int DefaultLambdaRuntimeEmulatorPort = 5050;
21+
public const int DefaultLambdaEmulatorPort = 5050;
2222

2323
/// <summary>
2424
/// The default port used by the API Gateway Emulator.
@@ -28,7 +28,7 @@ public abstract class Constants
2828
/// <summary>
2929
/// The default hostname used for the Lambda Test Tool.
3030
/// </summary>
31-
public const string DefaultHost = "localhost";
31+
public const string DefaultLambdaEmulatorHost = "localhost";
3232

3333
/// <summary>
3434
/// The default mode for the API Gateway Emulator.

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Processes/ApiGatewayEmulatorProcess.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static ApiGatewayEmulatorProcess Startup(RunCommandSettings settings, Can
4848

4949
builder.Services.AddApiGatewayEmulatorServices();
5050

51-
var serviceUrl = $"http://{settings.Host}:{settings.ApiGatewayEmulatorPort}";
51+
var serviceUrl = $"http://{settings.LambdaEmulatorHost}:{settings.ApiGatewayEmulatorPort}";
5252
builder.WebHost.UseUrls(serviceUrl);
5353
builder.WebHost.SuppressStatusMessages(true);
5454

@@ -145,7 +145,7 @@ public static ApiGatewayEmulatorProcess Startup(RunCommandSettings settings, Can
145145
/// </remarks>
146146
private static IAmazonLambda CreateLambdaServiceClient(ApiGatewayRouteConfig routeConfig, RunCommandSettings settings)
147147
{
148-
var endpoint = routeConfig.Endpoint ?? $"http://{settings.Host}:{settings.Port}";
148+
var endpoint = routeConfig.Endpoint ?? $"http://{settings.LambdaEmulatorHost}:{settings.LambdaEmulatorPort}";
149149

150150
var lambdaConfig = new AmazonLambdaConfig
151151
{

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Processes/TestToolProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static TestToolProcess Startup(RunCommandSettings settings, CancellationT
5454
}
5555
builder.Services.AddSingleton<IDirectoryManager, DirectoryManager>();
5656

57-
var serviceUrl = $"http://{settings.Host}:{settings.Port}";
57+
var serviceUrl = $"http://{settings.LambdaEmulatorHost}:{settings.LambdaEmulatorPort}";
5858
builder.WebHost.UseUrls(serviceUrl);
5959
builder.WebHost.SuppressStatusMessages(true);
6060

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayEmulatorProcessTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private void StartTestToolProcess(ApiGatewayEmulatorMode apiGatewayMode, TestCon
244244
""Path"": ""/{config.RouteName}""
245245
}}");
246246
cancellationTokenSource.CancelAfter(5000);
247-
var settings = new RunCommandSettings { Port = lambdaPort, NoLaunchWindow = true, ApiGatewayEmulatorMode = apiGatewayMode,ApiGatewayEmulatorPort = apiGatewayPort};
247+
var settings = new RunCommandSettings { LambdaEmulatorPort = lambdaPort, NoLaunchWindow = true, ApiGatewayEmulatorMode = apiGatewayMode,ApiGatewayEmulatorPort = apiGatewayPort};
248248
var command = new RunCommand(_mockInteractiveService.Object);
249249
var context = new CommandContext(new List<string>(), _mockRemainingArgs.Object, "run", null);
250250

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Commands/RunCommandTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public async Task ExecuteAsync_LambdaRuntimeApi_SuccessfulLaunch()
2424
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
2525
var cancellationSource = new CancellationTokenSource();
2626
cancellationSource.CancelAfter(5000);
27-
var settings = new RunCommandSettings { Port = 9001, NoLaunchWindow = true };
27+
var settings = new RunCommandSettings { LambdaEmulatorPort = 9001, NoLaunchWindow = true };
2828
var command = new RunCommand(_mockInteractiveService.Object);
2929
var context = new CommandContext(new List<string>(), _mockRemainingArgs.Object, "run", null);
30-
var apiUrl = $"http://{settings.Host}:{settings.Port}";
30+
var apiUrl = $"http://{settings.LambdaEmulatorHost}:{settings.LambdaEmulatorPort}";
3131

3232
// Act
3333
var runningTask = command.ExecuteAsync(context, settings, cancellationSource);
@@ -47,10 +47,10 @@ public async Task ExecuteAsync_ApiGatewayEmulator_SuccessfulLaunch()
4747
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
4848
var cancellationSource = new CancellationTokenSource();
4949
cancellationSource.CancelAfter(5000);
50-
var settings = new RunCommandSettings { Port = 9002, ApiGatewayEmulatorMode = ApiGatewayEmulatorMode.HttpV2, NoLaunchWindow = true};
50+
var settings = new RunCommandSettings { LambdaEmulatorPort = 9002, ApiGatewayEmulatorMode = ApiGatewayEmulatorMode.HttpV2, NoLaunchWindow = true};
5151
var command = new RunCommand(_mockInteractiveService.Object);
5252
var context = new CommandContext(new List<string>(), _mockRemainingArgs.Object, "run", null);
53-
var apiUrl = $"http://{settings.Host}:{settings.ApiGatewayEmulatorPort}/__lambda_test_tool_apigateway_health__";
53+
var apiUrl = $"http://{settings.LambdaEmulatorHost}:{settings.ApiGatewayEmulatorPort}/__lambda_test_tool_apigateway_health__";
5454

5555
// Act
5656
var runningTask = command.ExecuteAsync(context, settings, cancellationSource);

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Commands/Settings/RunCommandSettingsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void DefaultHost_IsSetToConstantsDefaultHost()
1515
var settings = new RunCommandSettings();
1616

1717
// Assert
18-
Assert.Equal(Constants.DefaultHost, settings.Host);
18+
Assert.Equal(Constants.DefaultLambdaEmulatorHost, settings.LambdaEmulatorHost);
1919
}
2020

2121
[Fact]
@@ -25,7 +25,7 @@ public void DefaultPort_IsSetToConstantsDefaultPort()
2525
var settings = new RunCommandSettings();
2626

2727
// Assert
28-
Assert.Equal(Constants.DefaultLambdaRuntimeEmulatorPort, settings.Port);
28+
Assert.Equal(Constants.DefaultLambdaEmulatorPort, settings.LambdaEmulatorPort);
2929
}
3030

3131
[Fact]

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Processes/ApiGatewayEmulatorProcessTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task RouteNotFound(ApiGatewayEmulatorMode mode, HttpStatusCode stat
2222
var cancellationSource = new CancellationTokenSource();
2323
cancellationSource.CancelAfter(5000);
2424
var settings = new RunCommandSettings { ApiGatewayEmulatorPort = 9003, ApiGatewayEmulatorMode = mode, NoLaunchWindow = true};
25-
var apiUrl = $"http://{settings.Host}:{settings.ApiGatewayEmulatorPort}/__lambda_test_tool_apigateway_health__";
25+
var apiUrl = $"http://{settings.LambdaEmulatorHost}:{settings.ApiGatewayEmulatorPort}/__lambda_test_tool_apigateway_health__";
2626

2727
// Act
2828
var process = ApiGatewayEmulatorProcess.Startup(settings, cancellationSource.Token);

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/RuntimeApiTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task AddEventToDataStore()
2424

2525
var cancellationTokenSource = new CancellationTokenSource();
2626
var options = new RunCommandSettings();
27-
options.Port = 9000;
27+
options.LambdaEmulatorPort = 9000;
2828
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
2929
var testToolProcess = TestToolProcess.Startup(options, cancellationTokenSource.Token);
3030
try
@@ -53,7 +53,7 @@ public async Task AddEventToDataStore()
5353
return input.ToUpper();
5454
};
5555

56-
System.Environment.SetEnvironmentVariable("AWS_LAMBDA_RUNTIME_API", $"{options.Host}:{options.Port}/{functionName}");
56+
System.Environment.SetEnvironmentVariable("AWS_LAMBDA_RUNTIME_API", $"{options.LambdaEmulatorHost}:{options.LambdaEmulatorPort}/{functionName}");
5757
_ = LambdaBootstrapBuilder.Create(handler, new DefaultLambdaJsonSerializer())
5858
.Build()
5959
.RunAsync(cancellationTokenSource.Token);
@@ -74,7 +74,7 @@ public async Task InvokeRequestResponse()
7474

7575
var cancellationTokenSource = new CancellationTokenSource();
7676
var options = new RunCommandSettings();
77-
options.Port = 9001;
77+
options.LambdaEmulatorPort = 9001;
7878
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
7979
var testToolProcess = TestToolProcess.Startup(options, cancellationTokenSource.Token);
8080
try
@@ -85,7 +85,7 @@ public async Task InvokeRequestResponse()
8585
return input.ToUpper();
8686
};
8787

88-
System.Environment.SetEnvironmentVariable("AWS_LAMBDA_RUNTIME_API", $"{options.Host}:{options.Port}/{functionName}");
88+
System.Environment.SetEnvironmentVariable("AWS_LAMBDA_RUNTIME_API", $"{options.LambdaEmulatorHost}:{options.LambdaEmulatorPort}/{functionName}");
8989
_ = LambdaBootstrapBuilder.Create(handler, new DefaultLambdaJsonSerializer())
9090
.Build()
9191
.RunAsync(cancellationTokenSource.Token);

0 commit comments

Comments
 (0)