13
13
using System . Threading . Tasks ;
14
14
using Amazon . CloudFormation ;
15
15
using Amazon . ECS ;
16
- using Amazon . Runtime ;
17
16
using AWS . Deploy . CLI . Commands ;
18
17
using AWS . Deploy . CLI . Commands . Settings ;
19
18
using AWS . Deploy . CLI . Common . UnitTests . IO ;
20
- using AWS . Deploy . CLI . Extensions ;
21
19
using AWS . Deploy . CLI . IntegrationTests . Extensions ;
22
20
using AWS . Deploy . CLI . IntegrationTests . Helpers ;
23
21
using AWS . Deploy . CLI . IntegrationTests . Services ;
24
22
using AWS . Deploy . CLI . IntegrationTests . Utilities ;
25
23
using AWS . Deploy . CLI . ServerMode ;
26
- using AWS . Deploy . Orchestration . Utilities ;
27
24
using AWS . Deploy . ServerMode . Client ;
28
25
using AWS . Deploy . ServerMode . Client . Utilities ;
29
- using Microsoft . Extensions . DependencyInjection ;
30
26
using Newtonsoft . Json ;
31
27
using Xunit ;
32
28
@@ -36,7 +32,6 @@ public class ServerModeTests : IDisposable
36
32
{
37
33
private bool _isDisposed ;
38
34
private string _stackName ;
39
- private readonly IServiceProvider _serviceProvider ;
40
35
private readonly CloudFormationHelper _cloudFormationHelper ;
41
36
42
37
private readonly string _awsRegion ;
@@ -50,13 +45,6 @@ public ServerModeTests()
50
45
var cloudFormationClient = new AmazonCloudFormationClient ( Amazon . RegionEndpoint . USWest2 ) ;
51
46
_cloudFormationHelper = new CloudFormationHelper ( cloudFormationClient ) ;
52
47
53
- var serviceCollection = new ServiceCollection ( ) ;
54
-
55
- serviceCollection . AddCustomServices ( ) ;
56
- serviceCollection . AddTestServices ( ) ;
57
-
58
- _serviceProvider = serviceCollection . BuildServiceProvider ( ) ;
59
-
60
48
_awsRegion = "us-west-2" ;
61
49
62
50
_testAppManager = new TestAppManager ( ) ;
@@ -77,7 +65,7 @@ public async Task ConfirmLocalhostOnly()
77
65
ParentPid = null ,
78
66
UnsecureMode = true
79
67
} ;
80
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
68
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
81
69
var cancelSource = new CancellationTokenSource ( ) ;
82
70
83
71
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -114,7 +102,7 @@ public async Task GetRecommendations()
114
102
ParentPid = null ,
115
103
UnsecureMode = true
116
104
} ;
117
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
105
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
118
106
var cancelSource = new CancellationTokenSource ( ) ;
119
107
120
108
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -177,7 +165,7 @@ public async Task GetRecommendationsWithEncryptedCredentials()
177
165
ParentPid = null ,
178
166
UnsecureMode = false
179
167
} ;
180
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
168
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
181
169
var cancelSource = new CancellationTokenSource ( ) ;
182
170
183
171
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -224,7 +212,7 @@ public async Task AppRunnerRedeployment_VisibleOnRedeploymentSettings()
224
212
ParentPid = null ,
225
213
UnsecureMode = true
226
214
} ;
227
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
215
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
228
216
var cancelSource = new CancellationTokenSource ( ) ;
229
217
230
218
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -312,7 +300,7 @@ public async Task WebFargateDeploymentNoConfigChanges()
312
300
ParentPid = null ,
313
301
UnsecureMode = true
314
302
} ;
315
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
303
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
316
304
var cancelSource = new CancellationTokenSource ( ) ;
317
305
318
306
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -447,7 +435,7 @@ public async Task RecommendationsForNewDeployments_DoesNotIncludeExistingBeansta
447
435
ParentPid = null ,
448
436
UnsecureMode = true
449
437
} ;
450
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
438
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
451
439
var cancelSource = new CancellationTokenSource ( ) ;
452
440
453
441
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -491,7 +479,7 @@ public async Task ShutdownViaRestClient()
491
479
ParentPid = null ,
492
480
UnsecureMode = true
493
481
} ;
494
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
482
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
495
483
var cancelSource = new CancellationTokenSource ( ) ;
496
484
497
485
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -532,7 +520,7 @@ public async Task InvalidStackName_ThrowsException(string invalidStackName)
532
520
ParentPid = null ,
533
521
UnsecureMode = true
534
522
} ;
535
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
523
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
536
524
var cancelSource = new CancellationTokenSource ( ) ;
537
525
538
526
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
@@ -583,7 +571,7 @@ public async Task CheckCategories()
583
571
ParentPid = null ,
584
572
UnsecureMode = true
585
573
} ;
586
- var serverCommand = new ServerModeCommand ( _serviceProvider . GetRequiredService < IToolInteractiveService > ( ) ) ;
574
+ var serverCommand = new ServerModeCommand ( _interactiveService ) ;
587
575
var cancelSource = new CancellationTokenSource ( ) ;
588
576
589
577
_ = serverCommand . ExecuteAsync ( null ! , serverCommandSettings , cancelSource ) ;
0 commit comments