Skip to content

Commit 52de9ac

Browse files
authored
update monitor test and design by autorest change (#24099)
1 parent 743c04f commit 52de9ac

10 files changed

+366
-470
lines changed

src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Recording.json

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,20 @@
1717
"Headers": {
1818
"Cache-Control": [ "no-cache" ],
1919
"Pragma": [ "no-cache" ],
20-
"X-ActivityId": [ "bed8f3e7-6d2e-4d84-a9b7-b440bfe27658" ],
20+
"X-ActivityId": [ "9b6af2d6-a94d-42ea-b711-a12978ee3327" ],
2121
"Access-Control-Expose-Headers": [ "x-activityid" ],
2222
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
2323
"X-Frame-Options": [ "SAMEORIGIN" ],
24-
"X-ServedBy": [ "SN1AZNS000001" ],
24+
"X-ServedBy": [ "SN2AZNS000005" ],
2525
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
26-
"Server": [ "Microsoft-HTTPAPI/2.0" ],
2726
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
28-
"x-ms-request-id": [ "67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
29-
"x-ms-correlation-request-id": [ "67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
30-
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053833Z:67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
27+
"x-ms-request-id": [ "7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
28+
"x-ms-correlation-request-id": [ "7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
29+
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084834Z:7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
3130
"X-Content-Type-Options": [ "nosniff" ],
32-
"Date": [ "Wed, 08 Nov 2023 05:38:33 GMT" ]
31+
"X-Cache": [ "CONFIG_NOCACHE" ],
32+
"X-MSEdge-Ref": [ "Ref A: 0A6BDA0052414F6FA3138C9654DC4E10 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:32Z" ],
33+
"Date": [ "Sun, 04 Feb 2024 08:48:34 GMT" ]
3334
},
3435
"ContentHeaders": {
3536
"Content-Length": [ "156" ],
@@ -47,12 +48,12 @@
4748
"Content": null,
4849
"isContentBase64": false,
4950
"Headers": {
50-
"x-ms-unique-id": [ "5" ],
51-
"x-ms-client-request-id": [ "6dec28d8-b20a-482a-a339-d8378099d5a5" ],
51+
"x-ms-unique-id": [ "8" ],
52+
"x-ms-client-request-id": [ "88d6c762-ffc9-4310-9efa-898aabfaa28b" ],
5253
"CommandName": [ "Get-AzActionGroup" ],
5354
"FullCommandName": [ "Get-AzActionGroup_Get" ],
5455
"ParameterSetName": [ "__AllParameterSets" ],
55-
"User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
56+
"User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
5657
"Authorization": [ "[Filtered]" ]
5758
},
5859
"ContentHeaders": {
@@ -63,19 +64,20 @@
6364
"Headers": {
6465
"Cache-Control": [ "no-cache" ],
6566
"Pragma": [ "no-cache" ],
66-
"X-ActivityId": [ "6dec28d8-b20a-482a-a339-d8378099d5a5" ],
67+
"X-ActivityId": [ "88d6c762-ffc9-4310-9efa-898aabfaa28b" ],
6768
"Access-Control-Expose-Headers": [ "x-activityid" ],
6869
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
6970
"X-Frame-Options": [ "SAMEORIGIN" ],
70-
"X-ServedBy": [ "SN1AZNS000001" ],
71+
"X-ServedBy": [ "SN2AZNS000007" ],
7172
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
72-
"Server": [ "Microsoft-HTTPAPI/2.0" ],
7373
"x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
74-
"x-ms-request-id": [ "3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
75-
"x-ms-correlation-request-id": [ "3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
76-
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053834Z:3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
74+
"x-ms-request-id": [ "f827b29f-5f42-444b-acdb-5325adc7bea9" ],
75+
"x-ms-correlation-request-id": [ "f827b29f-5f42-444b-acdb-5325adc7bea9" ],
76+
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084836Z:f827b29f-5f42-444b-acdb-5325adc7bea9" ],
7777
"X-Content-Type-Options": [ "nosniff" ],
78-
"Date": [ "Wed, 08 Nov 2023 05:38:34 GMT" ]
78+
"X-Cache": [ "CONFIG_NOCACHE" ],
79+
"X-MSEdge-Ref": [ "Ref A: 662AEEFE427947F8868907FCE56BA4AB Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:34Z" ],
80+
"Date": [ "Sun, 04 Feb 2024 08:48:36 GMT" ]
7981
},
8082
"ContentHeaders": {
8183
"Content-Length": [ "777" ],
@@ -104,19 +106,20 @@
104106
"Headers": {
105107
"Cache-Control": [ "no-cache" ],
106108
"Pragma": [ "no-cache" ],
107-
"X-ActivityId": [ "e173494b-ac91-4386-b8d8-40a6556acc6c" ],
109+
"X-ActivityId": [ "e7014e5a-a668-46c0-ac5b-cf952afdaf1a" ],
108110
"Access-Control-Expose-Headers": [ "x-activityid" ],
109111
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
110112
"X-Frame-Options": [ "SAMEORIGIN" ],
111-
"X-ServedBy": [ "SN1AZNS000001" ],
113+
"X-ServedBy": [ "SN2AZNS000008" ],
112114
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
113-
"Server": [ "Microsoft-HTTPAPI/2.0" ],
114-
"x-ms-ratelimit-remaining-subscription-writes": [ "1198" ],
115-
"x-ms-request-id": [ "08559265-1150-41df-aad8-73c7d374943f" ],
116-
"x-ms-correlation-request-id": [ "08559265-1150-41df-aad8-73c7d374943f" ],
117-
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053835Z:08559265-1150-41df-aad8-73c7d374943f" ],
115+
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
116+
"x-ms-request-id": [ "7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
117+
"x-ms-correlation-request-id": [ "7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
118+
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084839Z:7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
118119
"X-Content-Type-Options": [ "nosniff" ],
119-
"Date": [ "Wed, 08 Nov 2023 05:38:34 GMT" ]
120+
"X-Cache": [ "CONFIG_NOCACHE" ],
121+
"X-MSEdge-Ref": [ "Ref A: 082BF55A3386421BB43FF609C6C1DF7C Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:37Z" ],
122+
"Date": [ "Sun, 04 Feb 2024 08:48:39 GMT" ]
120123
},
121124
"ContentHeaders": {
122125
"Content-Length": [ "159" ],

src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Tests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'Enable-AzActionGroupReceiver'
1717
Describe 'Enable-AzActionGroupReceiver' {
1818
It 'EnableExpanded' {
1919
{
20+
# Receiver with name smsreceiver in action group with Id MONITOR:xx is already enabled
2021
Enable-AzActionGroupReceiver -ActionGroupName $env.actiongroupname -ResourceGroupName $env.resourceGroup -ReceiverName $env.smsreceiver
21-
} | Should -Not -Throw
22+
} | Should -Throw "is already enabled"
2223
}
2324

2425
It 'EnableViaJsonString' -skip {
@@ -30,9 +31,10 @@ Describe 'Enable-AzActionGroupReceiver' {
3031
}
3132

3233
It 'EnableViaIdentityExpanded' {
33-
{
34+
{
35+
# Receiver with name smsreceiver in action group with Id MONITOR:xx is already enabled
3436
$ag = Get-AzActionGroup -Name $env.actiongroupname -ResourceGroupName $env.resourceGroup
3537
Enable-AzActionGroupReceiver -InputObject $ag -ReceiverName $env.emailreceiver1
36-
} | Should -Not -Throw
38+
} | Should -Throw "is already enabled"
3739
}
3840
}

0 commit comments

Comments
 (0)