Skip to content

Commit 9badd2e

Browse files
committed
commit 8
1 parent 6e9d9e1 commit 9badd2e

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

test/AWS.Deploy.CLI.IntegrationTests/ServerModeTests.cs

+9-21
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313
using System.Threading.Tasks;
1414
using Amazon.CloudFormation;
1515
using Amazon.ECS;
16-
using Amazon.Runtime;
1716
using AWS.Deploy.CLI.Commands;
1817
using AWS.Deploy.CLI.Commands.Settings;
1918
using AWS.Deploy.CLI.Common.UnitTests.IO;
20-
using AWS.Deploy.CLI.Extensions;
2119
using AWS.Deploy.CLI.IntegrationTests.Extensions;
2220
using AWS.Deploy.CLI.IntegrationTests.Helpers;
2321
using AWS.Deploy.CLI.IntegrationTests.Services;
2422
using AWS.Deploy.CLI.IntegrationTests.Utilities;
2523
using AWS.Deploy.CLI.ServerMode;
26-
using AWS.Deploy.Orchestration.Utilities;
2724
using AWS.Deploy.ServerMode.Client;
2825
using AWS.Deploy.ServerMode.Client.Utilities;
29-
using Microsoft.Extensions.DependencyInjection;
3026
using Newtonsoft.Json;
3127
using Xunit;
3228

@@ -36,7 +32,6 @@ public class ServerModeTests : IDisposable
3632
{
3733
private bool _isDisposed;
3834
private string _stackName;
39-
private readonly IServiceProvider _serviceProvider;
4035
private readonly CloudFormationHelper _cloudFormationHelper;
4136

4237
private readonly string _awsRegion;
@@ -50,13 +45,6 @@ public ServerModeTests()
5045
var cloudFormationClient = new AmazonCloudFormationClient(Amazon.RegionEndpoint.USWest2);
5146
_cloudFormationHelper = new CloudFormationHelper(cloudFormationClient);
5247

53-
var serviceCollection = new ServiceCollection();
54-
55-
serviceCollection.AddCustomServices();
56-
serviceCollection.AddTestServices();
57-
58-
_serviceProvider = serviceCollection.BuildServiceProvider();
59-
6048
_awsRegion = "us-west-2";
6149

6250
_testAppManager = new TestAppManager();
@@ -77,7 +65,7 @@ public async Task ConfirmLocalhostOnly()
7765
ParentPid = null,
7866
UnsecureMode = true
7967
};
80-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
68+
var serverCommand = new ServerModeCommand(_interactiveService);
8169
var cancelSource = new CancellationTokenSource();
8270

8371
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -114,7 +102,7 @@ public async Task GetRecommendations()
114102
ParentPid = null,
115103
UnsecureMode = true
116104
};
117-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
105+
var serverCommand = new ServerModeCommand(_interactiveService);
118106
var cancelSource = new CancellationTokenSource();
119107

120108
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -177,7 +165,7 @@ public async Task GetRecommendationsWithEncryptedCredentials()
177165
ParentPid = null,
178166
UnsecureMode = false
179167
};
180-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
168+
var serverCommand = new ServerModeCommand(_interactiveService);
181169
var cancelSource = new CancellationTokenSource();
182170

183171
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -224,7 +212,7 @@ public async Task AppRunnerRedeployment_VisibleOnRedeploymentSettings()
224212
ParentPid = null,
225213
UnsecureMode = true
226214
};
227-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
215+
var serverCommand = new ServerModeCommand(_interactiveService);
228216
var cancelSource = new CancellationTokenSource();
229217

230218
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -312,7 +300,7 @@ public async Task WebFargateDeploymentNoConfigChanges()
312300
ParentPid = null,
313301
UnsecureMode = true
314302
};
315-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
303+
var serverCommand = new ServerModeCommand(_interactiveService);
316304
var cancelSource = new CancellationTokenSource();
317305

318306
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -447,7 +435,7 @@ public async Task RecommendationsForNewDeployments_DoesNotIncludeExistingBeansta
447435
ParentPid = null,
448436
UnsecureMode = true
449437
};
450-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
438+
var serverCommand = new ServerModeCommand(_interactiveService);
451439
var cancelSource = new CancellationTokenSource();
452440

453441
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -491,7 +479,7 @@ public async Task ShutdownViaRestClient()
491479
ParentPid = null,
492480
UnsecureMode = true
493481
};
494-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
482+
var serverCommand = new ServerModeCommand(_interactiveService);
495483
var cancelSource = new CancellationTokenSource();
496484

497485
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -532,7 +520,7 @@ public async Task InvalidStackName_ThrowsException(string invalidStackName)
532520
ParentPid = null,
533521
UnsecureMode = true
534522
};
535-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
523+
var serverCommand = new ServerModeCommand(_interactiveService);
536524
var cancelSource = new CancellationTokenSource();
537525

538526
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);
@@ -583,7 +571,7 @@ public async Task CheckCategories()
583571
ParentPid = null,
584572
UnsecureMode = true
585573
};
586-
var serverCommand = new ServerModeCommand(_serviceProvider.GetRequiredService<IToolInteractiveService>());
574+
var serverCommand = new ServerModeCommand(_interactiveService);
587575
var cancelSource = new CancellationTokenSource();
588576

589577
_ = serverCommand.ExecuteAsync(null!, serverCommandSettings, cancelSource);

0 commit comments

Comments
 (0)