@@ -435,14 +435,24 @@ function Test-CRUDNotificationHub
435
435
$createdNotificationHub.WnsCredential.PackageSid = " ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699"
436
436
$createdNotificationHub.WnsCredential.SecretKey = " w7TBprR-9tJxn9mUOdK4PPHLCAzSYFhp"
437
437
$createdNotificationHub.WnsCredential.WindowsLiveEndpoint = " http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf"
438
+ $createdNotificationHub.ApnsCredential = New-Object ' Microsoft.Azure.Management.NotificationHubs.Models.ApnsCredential'
439
+ $createdNotificationHub.ApnsCredential.KeyId = " TXRXD9P6K7"
440
+ $createdNotificationHub.ApnsCredential.Token = " MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgpVB15km4qskA5Ra5XvdtOwWPvaXIhVVQZdonzINh+hGgCgYIKoZIzj0DAQehRANCAASS3ek04J20BqA6WWDlD6+xd3dJEifhW87wI0nnkfUB8LDb424TiWlzGIgnxV79hb3QHCAUNsPdBfLLF+Od8yqL"
441
+ $createdNotificationHub.ApnsCredential.AppName = " Sample"
442
+ $createdNotificationHub.ApnsCredential.AppId = " EF9WEB9D5K"
443
+ $createdNotificationHub.ApnsCredential.Endpoint = " https://api.push.apple.com:443/3/device"
438
444
$result = New-AzureRmNotificationHub - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHubObj $createdNotificationHub
439
445
440
446
Write-Debug " Get the PNS credentials for the second notificationHub created"
441
447
$pnsCredentials = Get-AzureRmNotificationHubPNSCredentials - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHub $notificationHubName2
442
448
Assert-AreEqual $createdNotificationHub.WnsCredential.PackageSid $pnsCredentials.WnsCredential.PackageSid
443
449
Assert-AreEqual $createdNotificationHub.WnsCredential.SecretKey $pnsCredentials.WnsCredential.SecretKey
444
450
Assert-AreEqual $createdNotificationHub.WnsCredential.WindowsLiveEndpoint $pnsCredentials.WnsCredential.WindowsLiveEndpoint
445
-
451
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.KeyId $pnsCredentials.ApnsCredential.KeyId
452
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.Token $pnsCredentials.ApnsCredential.Token
453
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.AppName $pnsCredentials.ApnsCredential.AppName
454
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.AppId $pnsCredentials.ApnsCredential.AppId
455
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.Endpoint $pnsCredentials.ApnsCredential.Endpoint
446
456
Write-Debug " Get all the created notificationHub "
447
457
$createdNotificationHubList = Get-AzureRmNotificationHub - ResourceGroup $resourceGroupName - Namespace $namespaceName
448
458
@@ -468,7 +478,13 @@ function Test-CRUDNotificationHub
468
478
$createdNotificationHub.WnsCredential = New-Object ' Microsoft.Azure.Management.NotificationHubs.Models.WnsCredential'
469
479
$createdNotificationHub.WnsCredential.PackageSid = " ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699"
470
480
$createdNotificationHub.WnsCredential.SecretKey = " w7TBprR-9tJxn9mUOdK4PPHLCAzSYFhp"
481
+ $createdNotificationHub.ApnsCredential.KeyId = " TXRXD9P6K7"
482
+ $createdNotificationHub.ApnsCredential.Token = " MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgpVB15km4qskA5Ra5XvdtOwWPvaXIhVVQZdonzINh+hGgCgYIKoZIzj0DAQehRANCAASS3ek04J20BqA6WWDlD6+xd3dJEifhW87wI0nnkfUB8LDb424TiWlzGIgnxV79hb3QHCAUNsPdBfLLF+Od8yqL"
483
+ $createdNotificationHub.ApnsCredential.AppName = " Sample2"
484
+ $createdNotificationHub.ApnsCredential.AppId = " EF9WEB9D5K"
485
+ $createdNotificationHub.ApnsCredential.Endpoint = " https://api.push.apple.com:443/3/device"
471
486
$createdNotificationHub.WnsCredential.WindowsLiveEndpoint = " http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf"
487
+
472
488
$result = Set-AzureRmNotificationHub - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHubObj $createdNotificationHub - Force
473
489
if ($env: AZURE_TEST_MODE -ne " Playback" )
474
490
{
@@ -480,6 +496,11 @@ function Test-CRUDNotificationHub
480
496
Assert-AreEqual $createdNotificationHub.WnsCredential.PackageSid $pnsCredentials.WnsCredential.PackageSid
481
497
Assert-AreEqual $createdNotificationHub.WnsCredential.SecretKey $pnsCredentials.WnsCredential.SecretKey
482
498
Assert-AreEqual $createdNotificationHub.WnsCredential.WindowsLiveEndpoint $pnsCredentials.WnsCredential.WindowsLiveEndpoint
499
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.KeyId $pnsCredentials.ApnsCredential.KeyId
500
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.Token $pnsCredentials.ApnsCredential.Token
501
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.AppName $pnsCredentials.ApnsCredential.AppName
502
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.AppId $pnsCredentials.ApnsCredential.AppId
503
+ Assert-AreEqual $createdNotificationHub.ApnsCredential.Endpoint $pnsCredentials.ApnsCredential.Endpoint
483
504
484
505
# Test NotificationHub creation with tags as null
485
506
$result = New-AzureRmNotificationHub - ResourceGroup $resourceGroupName - Namespace $namespaceName - InputFile .\Resources\NewNotificationHubNoTags.json
0 commit comments