Skip to content

Commit 733d741

Browse files
committed
add recorded test
1 parent c6e2412 commit 733d741

File tree

5 files changed

+5610
-2
lines changed

5 files changed

+5610
-2
lines changed

src/Monitor/Monitor.Test/Monitor.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.25.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.2.0-preview" />
1616
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.19.0-preview" />
17+
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.19.0-preview" />
1718
</ItemGroup>
1819

1920
<ItemGroup>

src/Monitor/Monitor.Test/ScenarioTests/PrivateLinkScopeTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function Test-PrivateLinkScopeCRUD
9292
$subnetConfig = New-AzVirtualNetworkSubnetConfig -Name $config_name -AddressPrefix "11.0.1.0/24" -PrivateEndpointNetworkPolicies "Disabled"
9393
New-AzVirtualNetwork -ResourceGroupName $rg_name -Name $vnet_name -Location "eastus2euap" -AddressPrefix "11.0.0.0/16" -Subnet $subnetConfig
9494
$vnet=Get-AzVirtualNetwork -Name $vnet_name -ResourceGroupName $rg_name
95-
$plsConnection = New-AzPrivateLinkServiceConnection -Name $connection_name -PrivateLinkServiceId $scope1.Id -GroupId 'azuremonitor'
95+
$plsConnection = New-AzPrivateLinkServiceConnection -Name $connection_name -PrivateLinkServiceId $scope1.Id -GroupId $private_link_resource[0].GroupId
9696
New-AzPrivateEndpoint -ResourceGroupName $rg_name -Name $endpoint_name -Location "eastus2euap" -Subnet $vnet.subnets[0] -PrivateLinkServiceConnection $plsConnection -ByManualRequest
9797

9898
$connection = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $scope1.Id

src/Monitor/Monitor.Test/ScenarioTests/TestsController.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Microsoft.Azure.Management.Storage.Version2017_10_01;
1919
using Microsoft.Azure.Management.ApplicationInsights.Management;
2020
using Microsoft.Azure.Management.Network;
21+
using Microsoft.Azure.Management.OperationalInsights;
2122
using Microsoft.Azure.Test.HttpRecorder;
2223
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2324
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
@@ -47,6 +48,8 @@ public sealed class TestsController : RMTestBase
4748

4849
public AzureRestClient AzureRestClient { get; private set; }
4950

51+
public OperationalInsightsManagementClient OperationalInsightsManagementClient { get; private set; }
52+
5053
public static TestsController NewInstance => new TestsController();
5154

5255
public TestsController()
@@ -138,6 +141,7 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
138141
ApplicationInsightsClient = this.GetApplicationInsightsManagementClient(context: context, env: environment);
139142
NetworkManagementClient = this.GetNetworkManagementClient(context: context, env: environment);
140143
AzureRestClient = this.GetAzureRestClient(context: context, env: environment);
144+
OperationalInsightsManagementClient = GetOperationalInsightsManagementClient(context: context, env: environment);
141145
}
142146
else if (HttpMockServer.Mode == HttpRecorderMode.Playback)
143147
{
@@ -153,7 +157,8 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
153157
StorageManagementClient,
154158
this.ApplicationInsightsClient,
155159
this.NetworkManagementClient,
156-
this.AzureRestClient);
160+
this.AzureRestClient,
161+
this.OperationalInsightsManagementClient);
157162
}
158163

159164
private ResourceManagementClient GetResourceManagementClient(RestTestFramework.MockContext context, RestTestFramework.TestEnvironment env)
@@ -197,5 +202,12 @@ private AzureRestClient GetAzureRestClient(RestTestFramework.MockContext context
197202
? context.GetServiceClient<AzureRestClient>(currentEnvironment: env)
198203
: context.GetServiceClient<AzureRestClient>();
199204
}
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+
}
200212
}
201213
}

0 commit comments

Comments
 (0)