-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EventHubs]: Application Group CmdLets (#18640)
* Application Groups cmdlets * documentation * documentation and testing * fixes * fixes * upgrading other RP's that use EH * Update SignatureIssues.csv * pipeline fixes * changelog * fixes * Update ChangeLog.md Co-authored-by: Yabo Hu <yabhu@microsoft.com>
- Loading branch information
1 parent
5ac8ce6
commit ef7d983
Showing
48 changed files
with
19,110 additions
and
9,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/EventHub/EventHub.Test/ScenarioTests/PaginationTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
using Xunit; | ||
|
||
namespace Microsoft.Azure.Commands.EventHub.Test.ScenarioTests | ||
{ | ||
public class PaginationTests : EventHubTestRunner | ||
{ | ||
|
||
public PaginationTests(Xunit.Abstractions.ITestOutputHelper output) | ||
: base(output) | ||
{ | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void ApplicationGroupPaginationTests() | ||
{ | ||
TestRunner.RunTestScript("ApplicationGroupPagination"); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/EventHub/EventHub.Test/ScenarioTests/PaginationTests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ---------------------------------------------------------------------------------- | ||
# | ||
# Copyright Microsoft Corporation | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
<# | ||
.SYNOPSIS | ||
Tests pagination of various resources | ||
#> | ||
|
||
function ApplicationGroupPagination{ | ||
# Max allowed application groups in a namespace is 100 | ||
# Pagination does not really come into picture | ||
# But for any list call that gives a ListNext function we have to take pagination into account in the code | ||
# This is because if tommorrow, the server allows more than 100 app groups | ||
# We do not need any effort here to keep the code updated | ||
|
||
$resourceGroupName = "ps-testing" | ||
$namespaceName = "ps-pagination-testing" | ||
|
||
$listOfAppGroups = Get-AzEventHubApplicationGroup -ResourceGroupName $resourceGroupName -NamespaceName $namespaceName | ||
Assert-AreEqual 100 $listOfAppGroups.Count | ||
|
||
$namespaceId = Get-AzEventHubNamespace -ResourceGroupName $resourceGroupName -NamespaceName $namespaceName | ||
|
||
$listOfAppGroups = Get-AzEventHubApplicationGroup -ResourceId $namespaceId.Id | ||
Assert-AreEqual 100 $listOfAppGroups.Count | ||
|
||
$t1 = New-AzEventHubThrottlingPolicyConfig -Name t1 -MetricId IncomingMessages -RateLimitThreshold 10000 | ||
|
||
Assert-ThrowsContains { New-AzEventHubApplicationGroup -ResourceGroupName $resourceGroupName -NamespaceName $namespaceName -Name test -ClientAppGroupIdentifier SASKeyName=test -ThrottlingPolicyConfig $t1 } "Operation returned an invalid status code 'BadRequest'" | ||
} |
Oops, something went wrong.