@@ -227,11 +227,13 @@ public async Task TestLambdaWithNullEndpoint()
227
227
228
228
try
229
229
{
230
- StartTestToolProcessWithNullEndpoint ( ApiGatewayEmulatorMode . HttpV2 , Constants . DefaultApiGatewayEmulatorPort , config , cancellationTokenSource ) ;
231
- await WaitForGatewayHealthCheck ( Constants . DefaultApiGatewayEmulatorPort ) ;
232
- await StartLambdaProcess ( config , Constants . DefaultLambdaEmulatorPort ) ;
230
+ const int lambdaPort = 5060 ;
231
+ const int apiGatewayPort = 5061 ;
232
+ StartTestToolProcessWithNullEndpoint ( ApiGatewayEmulatorMode . HttpV2 , lambdaPort , apiGatewayPort , config , cancellationTokenSource ) ;
233
+ await WaitForGatewayHealthCheck ( apiGatewayPort ) ;
234
+ await StartLambdaProcess ( config , lambdaPort ) ;
233
235
234
- var response = await TestEndpoint ( config , Constants . DefaultApiGatewayEmulatorPort ) ;
236
+ var response = await TestEndpoint ( config , apiGatewayPort ) ;
235
237
var responseContent = await response . Content . ReadAsStringAsync ( ) ;
236
238
237
239
Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
@@ -264,7 +266,7 @@ private async Task<HttpResponseMessage> TestEndpoint(TestConfig config, int apiG
264
266
} ;
265
267
}
266
268
267
- private void StartTestToolProcessWithNullEndpoint ( ApiGatewayEmulatorMode apiGatewayMode , int apiGatewayPort , TestConfig config , CancellationTokenSource cancellationTokenSource )
269
+ private void StartTestToolProcessWithNullEndpoint ( ApiGatewayEmulatorMode apiGatewayMode , int lambdaPort , int apiGatewayPort , TestConfig config , CancellationTokenSource cancellationTokenSource )
268
270
{
269
271
Environment . SetEnvironmentVariable ( "ASPNETCORE_ENVIRONMENT" , "Development" ) ;
270
272
Environment . SetEnvironmentVariable ( "APIGATEWAY_EMULATOR_ROUTE_CONFIG" , $@ "{{
@@ -273,8 +275,8 @@ private void StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode apiGate
273
275
""Path"": ""/{ config . RouteName } ""
274
276
}}" ) ;
275
277
276
- cancellationTokenSource . CancelAfter ( 5000 ) ;
277
- var settings = new RunCommandSettings { NoLaunchWindow = true , ApiGatewayEmulatorMode = apiGatewayMode , ApiGatewayEmulatorPort = apiGatewayPort } ;
278
+ cancellationTokenSource . CancelAfter ( TimeSpan . FromSeconds ( 60 ) ) ;
279
+ var settings = new RunCommandSettings { NoLaunchWindow = true , ApiGatewayEmulatorMode = apiGatewayMode , ApiGatewayEmulatorPort = apiGatewayPort , LambdaEmulatorPort = lambdaPort } ;
278
280
279
281
var command = new RunCommand ( _mockInteractiveService . Object , _mockEnvironmentManager . Object ) ;
280
282
var context = new CommandContext ( new List < string > ( ) , _mockRemainingArgs . Object , "run" , null ) ;
0 commit comments