14
14
15
15
using Microsoft . Azure . Commands . Common . Authentication ;
16
16
using Microsoft . Azure . Gallery ;
17
- using Microsoft . Azure . Management . Authorization ;
18
17
using Microsoft . Azure . Management . DevTestLabs ;
19
- using Microsoft . Azure . Management . Resources ;
18
+ using Microsoft . Azure . Management . ResourceManager ;
20
19
using Microsoft . Azure . Management . Storage ;
21
- using Microsoft . Azure . Subscriptions ;
22
20
using Microsoft . Azure . Test . HttpRecorder ;
23
21
using Microsoft . Rest . ClientRuntime . Azure . TestFramework ;
24
22
using Microsoft . WindowsAzure . Commands . ScenarioTest ;
@@ -38,15 +36,13 @@ public class DevTestLabsController
38
36
private EnvironmentSetupHelper helper ;
39
37
private const string TenantIdKey = "TenantId" ;
40
38
private const string DomainKey = "Domain" ;
41
- private const string AuthorizationApiVersion = "2014-07-01-preview" ;
42
39
43
40
public ResourceManagementClient ResourceManagementClient { get ; private set ; }
44
41
45
42
public SubscriptionClient SubscriptionClient { get ; private set ; }
46
43
47
44
public DevTestLabsClient DevTestLabsClient { get ; private set ; }
48
45
49
- public AuthorizationManagementClient AuthorizationManagementClient { get ; private set ; }
50
46
51
47
public GalleryClient GalleryClient { get ; private set ; }
52
48
@@ -100,7 +96,7 @@ public void RunPsTestWorkflow(
100
96
d . Add ( "Microsoft.Features" , null ) ;
101
97
d . Add ( "Microsoft.Authorization" , null ) ;
102
98
var providersToIgnore = new Dictionary < string , string > ( ) ;
103
- providersToIgnore . Add ( "Microsoft.Azure.Management.Resources .ResourceManagementClient" , "2016-02-01" ) ;
99
+ providersToIgnore . Add ( "Microsoft.Azure.Management.ResourceManager .ResourceManagementClient" , "2016-02-01" ) ;
104
100
HttpMockServer . Matcher = new PermissiveRecordMatcherWithApiExclusion ( true , d , providersToIgnore ) ;
105
101
106
102
HttpMockServer . RecordsDirectory = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "SessionRecords" ) ;
@@ -121,7 +117,6 @@ public void RunPsTestWorkflow(
121
117
"ScenarioTests\\ Common.ps1" ,
122
118
"ScenarioTests\\ " + callingClassName + ".ps1" ,
123
119
helper . RMProfileModule ,
124
- helper . RMStorageDataPlaneModule ,
125
120
helper . RMResourceModule ,
126
121
helper . GetRMModulePath ( @"AzureRM.DevTestLabs.psd1" ) ) ;
127
122
@@ -149,17 +144,15 @@ public void RunPsTestWorkflow(
149
144
150
145
private void SetupManagementClients ( MockContext context )
151
146
{
152
- ResourceManagementClient = GetResourceManagementClient ( ) ;
153
- SubscriptionClient = GetSubscriptionClient ( ) ;
147
+ ResourceManagementClient = GetResourceManagementClient ( context ) ;
148
+ SubscriptionClient = GetSubscriptionClient ( context ) ;
154
149
DevTestLabsClient = GetDevTestLabsManagementClient ( context ) ;
155
- AuthorizationManagementClient = GetAuthorizationManagementClient ( ) ;
156
150
GalleryClient = GetGalleryClient ( ) ;
157
151
158
152
var armStorageManagementClient = GetArmStorageManagementClient ( ) ;
159
153
helper . SetupManagementClients ( ResourceManagementClient ,
160
154
SubscriptionClient ,
161
155
DevTestLabsClient ,
162
- AuthorizationManagementClient ,
163
156
GalleryClient ,
164
157
armStorageManagementClient
165
158
) ;
@@ -170,24 +163,20 @@ protected StorageManagementClient GetArmStorageManagementClient()
170
163
return LegacyTest . TestBase . GetServiceClient < StorageManagementClient > ( this . csmTestFactory ) ;
171
164
}
172
165
173
- private AuthorizationManagementClient GetAuthorizationManagementClient ( )
174
- {
175
- return LegacyTest . TestBase . GetServiceClient < AuthorizationManagementClient > ( this . csmTestFactory ) ;
176
- }
177
166
178
- private ResourceManagementClient GetResourceManagementClient ( )
167
+ private ResourceManagementClient GetResourceManagementClient ( MockContext context )
179
168
{
180
- return LegacyTest . TestBase . GetServiceClient < ResourceManagementClient > ( this . csmTestFactory ) ;
169
+ return context . GetServiceClient < ResourceManagementClient > ( TestEnvironmentFactory . GetTestEnvironment ( ) ) ;
181
170
}
182
171
183
172
private DevTestLabsClient GetDevTestLabsManagementClient ( MockContext context )
184
173
{
185
174
return context . GetServiceClient < DevTestLabsClient > ( TestEnvironmentFactory . GetTestEnvironment ( ) ) ;
186
175
}
187
176
188
- private SubscriptionClient GetSubscriptionClient ( )
177
+ private SubscriptionClient GetSubscriptionClient ( MockContext context )
189
178
{
190
- return LegacyTest . TestBase . GetServiceClient < SubscriptionClient > ( this . csmTestFactory ) ;
179
+ return context . GetServiceClient < SubscriptionClient > ( TestEnvironmentFactory . GetTestEnvironment ( ) ) ;
191
180
}
192
181
193
182
private GalleryClient GetGalleryClient ( )
0 commit comments