From 0b477ba7eaeec8183f7e0b90f0fab9be28bc918b Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 12 Jul 2023 14:42:54 +0200 Subject: [PATCH] rename global function --- ...cus.Scripting.IntegrationAccount.tests.ps1 | 272 +++++++++--------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index a5e21472..c11607a8 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -8,7 +8,7 @@ function global:New-PartnerFile () { return Get-ChildItem ($path) -File } -function global:Retry-Function-Integration ($func, $retryCount = 10, $retryIntervalSeconds = 1) { +function global:Retry-Function-IntegrationAccount ($func, $retryCount = 10, $retryIntervalSeconds = 1) { $attempt = 0 $success = $false $result = $null @@ -63,16 +63,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } It "Update a single schema in an Integration Account succeeds" { @@ -84,21 +84,21 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $expectedSchemaName = $schema.Name $executionDateTime = (Get-Date).ToUniversalTime() - $existingSchema = Retry-Function-Integration { New-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -SchemaFilePath $schema.FullName -ErrorAction Stop } + $existingSchema = Retry-Function-IntegrationAccount { New-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -SchemaFilePath $schema.FullName -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $existingSchema.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime $existingSchema.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } It "Create a single schema, without extension, in an Integration Account succeeds" { @@ -112,16 +112,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -RemoveFileExtensions -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } It "Create a single schema, without extension and with prefix, in an Integration Account succeeds" { @@ -136,16 +136,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } It "Create multiple schemas located in a folder in an Integration Account succeeds" { @@ -157,13 +157,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ErrorAction Stop } # Assert foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $schema.Name - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -173,7 +173,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $schema.Name - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } } @@ -186,13 +186,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -RemoveFileExtensions -ErrorAction Stop } # Assert foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $schema.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -202,7 +202,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $schema.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } } @@ -216,13 +216,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } # Assert foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $artifactsPrefix + $schema.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -232,7 +232,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($schema in Get-ChildItem("$schemasFolder") -File) { $expectedSchemaName = $artifactsPrefix + $schema.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force -ErrorAction Stop } } } } @@ -260,16 +260,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } It "Update a single map in an Integration Account succeeds" { @@ -281,21 +281,21 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $expectedMapName = $map.Name $executionDateTime = (Get-Date).ToUniversalTime() - $existingMap = Retry-Function-Integration { New-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -MapFilePath $map.FullName -ErrorAction Stop } + $existingMap = Retry-Function-IntegrationAccount { New-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -MapFilePath $map.FullName -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $existingMap.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime $existingMap.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } It "Create a single map, without extension, in an Integration Account succeeds" { @@ -309,16 +309,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -RemoveFileExtensions -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } It "Create a single map, without extension and with prefix, in an Integration Account succeeds" { @@ -333,16 +333,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } It "Create multiple maps located in a folder in an Integration Account succeeds" { @@ -354,13 +354,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ErrorAction Stop } # Assert foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $map.Name - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -370,7 +370,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $map.Name - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } } @@ -383,13 +383,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -RemoveFileExtensions -ErrorAction Stop } # Assert foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $map.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -399,7 +399,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $map.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } } @@ -413,13 +413,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ArtifactsPrefix $artifactsPrefix -RemoveFileExtensions -ErrorAction Stop } # Assert foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $artifactsPrefix + $map.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -429,7 +429,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($map in Get-ChildItem($mapsFolder) -File) { $expectedMapName = $artifactsPrefix + $map.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force -ErrorAction Stop } } } } @@ -457,16 +457,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -BeIn $actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } } } It "Update a single assembly in an Integration Account succeeds" { @@ -482,17 +482,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -BeIn $existingAssembly.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.Properties.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime $existingAssembly.Properties.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.Properties.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } } } It "Create a single assembly, with prefix, in an Integration Account succeeds" { @@ -507,16 +507,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } } } It "Create multiple assemblies located in a folder in an Integration Account succeeds" { @@ -528,13 +528,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop } # Assert foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { $expectedAssemblyName = $assembly.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -544,7 +544,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { $expectedAssemblyName = $assembly.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } } } } @@ -558,13 +558,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { $expectedAssemblyName = $artifactsPrefix + $assembly.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -574,7 +574,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { $expectedAssemblyName = $artifactsPrefix + $assembly.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -ErrorAction Stop } } } } @@ -602,16 +602,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } } } It "Update a single public certificate in an Integration Account succeeds" { @@ -627,17 +627,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $existingCertificate.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime $existingCertificate.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } } } It "Create a single public certificate, with prefix, in an Integration Account succeeds" { @@ -652,16 +652,16 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificateFilePath $certificate.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } } } It "Create multiple public certificates located in a folder in an Integration Account succeeds" { @@ -673,13 +673,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificatesFolder $certificatesFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificatesFolder $certificatesFolder -ErrorAction Stop } # Assert foreach ($certificate in Get-ChildItem($certificatesFolder) -File) { $expectedCertificateName = $certificate.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -689,7 +689,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($certificate in Get-ChildItem($certificatesFolder) -File) { $expectedCertificateName = $certificate.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } } } } @@ -703,13 +703,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificatesFolder $certificatesFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Public' -CertificatesFolder $certificatesFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert foreach ($certificate in Get-ChildItem($certificatesFolder) -File) { $expectedCertificateName = $artifactsPrefix + $certificate.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -719,7 +719,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($certificate in Get-ChildItem($certificatesFolder) -File) { $expectedCertificateName = $artifactsPrefix + $certificate.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } } } } @@ -740,17 +740,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Private' -CertificateFilePath $certificate.FullName -KeyName $key.Name -KeyVersion $key.Version -KeyVaultId $keyVaultId -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Private' -CertificateFilePath $certificate.FullName -KeyName $key.Name -KeyVersion $key.Version -KeyVaultId $keyVaultId -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzKeyVaultKey -VaultName $config.Arcus.KeyVault.VaultName -Name $keyName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzKeyVaultKey -VaultName $config.Arcus.KeyVault.VaultName -Name $keyName -Force -ErrorAction Stop } } } It "Create a single private certificate, with prefix, in an Integration Account succeeds" { @@ -771,17 +771,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Private' -CertificateFilePath $certificate.FullName -ArtifactsPrefix $artifactsPrefix -KeyName $key.Name -KeyVersion $key.Version -KeyVaultId $keyVaultId -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountCertificates -ResourceGroupName $resourceGroupName -Name $integrationAccountName -CertificateType 'Private' -CertificateFilePath $certificate.FullName -ArtifactsPrefix $artifactsPrefix -KeyName $key.Name -KeyVersion $key.Version -KeyVaultId $keyVaultId -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzKeyVaultKey -VaultName $config.Arcus.KeyVault.VaultName -Name $keyName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountCertificate -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -CertificateName $expectedCertificateName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzKeyVaultKey -VaultName $config.Arcus.KeyVault.VaultName -Name $keyName -Force -ErrorAction Stop } } } } @@ -807,17 +807,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-Item -Path $partner.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-Item -Path $partner.FullName -ErrorAction Stop } } } It "Update a single partner in an Integration Account succeeds" { @@ -832,18 +832,18 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $existingPartner.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime $existingPartner.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-Item -Path $partner.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-Item -Path $partner.FullName -ErrorAction Stop } } } It "Create a single partner, with prefix, in an Integration Account succeeds" { @@ -857,17 +857,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnerFilePath $partner.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-Item -Path $partner.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-Item -Path $partner.FullName -ErrorAction Stop } } } It "Create multiple partners located in a folder in an Integration Account succeeds" { @@ -879,13 +879,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnersFolder $partnersFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnersFolder $partnersFolder -ErrorAction Stop } # Assert foreach ($partner in Get-ChildItem($partnersFolder) -File) { $expectedPartnerName = $partner.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -895,7 +895,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($partner in Get-ChildItem($partnersFolder) -File) { $expectedPartnerName = $partner.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } } } } @@ -909,13 +909,13 @@ InModuleScope Arcus.Scripting.IntegrationAccount { try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnersFolder $partnersFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountPartners -ResourceGroupName $resourceGroupName -Name $integrationAccountName -PartnersFolder $partnersFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert foreach ($partner in Get-ChildItem($partnersFolder) -File) { $expectedPartnerName = $artifactsPrefix + $partner.BaseName - $actual = Retry-Function-Integration { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -ErrorAction Stop } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -925,7 +925,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { foreach ($partner in Get-ChildItem($partnersFolder) -File) { $expectedPartnerName = $artifactsPrefix + $partner.BaseName - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName $expectedPartnerName -Force -ErrorAction Stop } } } } @@ -952,23 +952,23 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $expectedAgreementName = $agreementData.name $executionDateTime = (Get-Date).ToUniversalTime() - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } } } It "Update a single agreement in an Integration Account succeeds" { @@ -990,17 +990,17 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $agreementData.properties.content.aS2.receiveAgreement.protocolSettings.messageConnectionSettings.ignoreCertificateNameMismatch = 'True' $agreementContent = $agreementData.properties.content | ConvertTo-Json -Depth 20 -Compress - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } $existingAgreement = New-AzIntegrationAccountAgreement -ResourceGroupName $ResourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -AgreementType $agreementType -HostPartner $hostPartner -HostIdentityQualifier $hostIdentityQualifier -HostIdentityQualifierValue $hostIdentityQualifierValue -GuestPartner $guestPartner -GuestIdentityQualifier $guestIdentityQualifier -GuestIdentityQualifierValue $guestIdentityQualifierValue -AgreementContent $agreementContent -ErrorAction Stop try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $existingAgreement.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime @@ -1008,9 +1008,9 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $existingAgreement.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.ChangedTime.ToUniversalTime() } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } } } It "Create a single agreement, with prefix, in an Integration Account succeeds" { @@ -1024,23 +1024,23 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $expectedAgreementName = $artifactsPrefix + $agreementData.name $executionDateTime = (Get-Date).ToUniversalTime() - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementFilePath $agreement.FullName -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime } finally { - Retry-Function-Integration { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } } } It "Create multiple agreements located in a folder in an Integration Account succeeds" { @@ -1050,19 +1050,19 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $agreementsFolder = "$PSScriptRoot\Files\IntegrationAccount\Agreements" $executionDateTime = (Get-Date).ToUniversalTime() - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementsFolder $agreementsFolder -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementsFolder $agreementsFolder -ErrorAction Stop } # Assert foreach ($agreement in Get-ChildItem($agreementsFolder) -File) { $agreementData = Get-Content -Raw -Path $agreement.FullName | ConvertFrom-Json $expectedAgreementName = $agreementData.name - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -1073,9 +1073,9 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $agreementData = Get-Content -Raw -Path $agreement.FullName | ConvertFrom-Json $expectedAgreementName = $agreementData.name - Retry-Function-Integration { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } } } } @@ -1087,19 +1087,19 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $artifactsPrefix = "dev-" $executionDateTime = (Get-Date).ToUniversalTime() - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } - Retry-Function-Integration { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -BusinessIdentities @("1", "12345") -ErrorAction Stop } + Retry-Function-IntegrationAccount { New-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -BusinessIdentities @("1", "98765") -ErrorAction Stop } try { # Act - Retry-Function-Integration { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementsFolder $agreementsFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } + Retry-Function-IntegrationAccount { Set-AzIntegrationAccountAgreements -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AgreementsFolder $agreementsFolder -ArtifactsPrefix $artifactsPrefix -ErrorAction Stop } # Assert foreach ($agreement in Get-ChildItem($agreementsFolder) -File) { $agreementData = Get-Content -Raw -Path $agreement.FullName | ConvertFrom-Json $expectedAgreementName = $artifactsPrefix + $agreementData.name - $actual = Retry-Function-Integration { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } + $actual = Retry-Function-IntegrationAccount { Get-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName } $actual | Should -Not -BeNullOrEmpty $actual.CreatedTime.ToUniversalTime().ToString("yyyy-MM-dd") | Should -Be $actual.ChangedTime.ToUniversalTime().ToString("yyyy-MM-dd") $actual.CreatedTime | Should -BeGreaterOrEqual $executionDateTime @@ -1110,9 +1110,9 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $agreementData = Get-Content -Raw -Path $agreement.FullName | ConvertFrom-Json $expectedAgreementName = $artifactsPrefix + $agreementData.name - Retry-Function-Integration { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } - Retry-Function-Integration { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountAgreement -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AgreementName $expectedAgreementName -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner1 -Force -ErrorAction Stop } + Retry-Function-IntegrationAccount { Remove-AzIntegrationAccountPartner -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -PartnerName Partner2 -Force -ErrorAction Stop } } } }