18
18
using Microsoft . Azure . Management . Storage . Version2017_10_01 ;
19
19
using Microsoft . Azure . Management . ApplicationInsights . Management ;
20
20
using Microsoft . Azure . Management . Network ;
21
+ using Microsoft . Azure . Management . OperationalInsights ;
21
22
using Microsoft . Azure . Test . HttpRecorder ;
22
23
using Microsoft . WindowsAzure . Commands . ScenarioTest ;
23
24
using Microsoft . WindowsAzure . Commands . Test . Utilities . Common ;
@@ -47,6 +48,8 @@ public sealed class TestsController : RMTestBase
47
48
48
49
public AzureRestClient AzureRestClient { get ; private set ; }
49
50
51
+ public OperationalInsightsManagementClient OperationalInsightsManagementClient { get ; private set ; }
52
+
50
53
public static TestsController NewInstance => new TestsController ( ) ;
51
54
52
55
public TestsController ( )
@@ -138,6 +141,7 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
138
141
ApplicationInsightsClient = this . GetApplicationInsightsManagementClient ( context : context , env : environment ) ;
139
142
NetworkManagementClient = this . GetNetworkManagementClient ( context : context , env : environment ) ;
140
143
AzureRestClient = this . GetAzureRestClient ( context : context , env : environment ) ;
144
+ OperationalInsightsManagementClient = GetOperationalInsightsManagementClient ( context : context , env : environment ) ;
141
145
}
142
146
else if ( HttpMockServer . Mode == HttpRecorderMode . Playback )
143
147
{
@@ -153,7 +157,8 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
153
157
StorageManagementClient ,
154
158
this . ApplicationInsightsClient ,
155
159
this . NetworkManagementClient ,
156
- this . AzureRestClient ) ;
160
+ this . AzureRestClient ,
161
+ this . OperationalInsightsManagementClient ) ;
157
162
}
158
163
159
164
private ResourceManagementClient GetResourceManagementClient ( RestTestFramework . MockContext context , RestTestFramework . TestEnvironment env )
@@ -197,5 +202,12 @@ private AzureRestClient GetAzureRestClient(RestTestFramework.MockContext context
197
202
? context . GetServiceClient < AzureRestClient > ( currentEnvironment : env )
198
203
: context . GetServiceClient < AzureRestClient > ( ) ;
199
204
}
205
+
206
+ private OperationalInsightsManagementClient GetOperationalInsightsManagementClient ( RestTestFramework . MockContext context , RestTestFramework . TestEnvironment env )
207
+ {
208
+ return env != null
209
+ ? context . GetServiceClient < OperationalInsightsManagementClient > ( currentEnvironment : env )
210
+ : context . GetServiceClient < OperationalInsightsManagementClient > ( ) ;
211
+ }
200
212
}
201
213
}
0 commit comments