From cea126626c46fba362ef224bedae45162363136d Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 15 Apr 2024 11:45:38 -0600 Subject: [PATCH] skip routing policy associations for now --- .../test/Set-JcSdkUserAssociation.Tests.ps1 | 6 ++++-- .../test/Set-JcSdkUserGroupAssociation.Tests.ps1 | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserAssociation.Tests.ps1 b/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserAssociation.Tests.ps1 index a0b53b5f0..30587edf8 100644 --- a/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserAssociation.Tests.ps1 +++ b/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserAssociation.Tests.ps1 @@ -17,7 +17,8 @@ while(-not $mockingPath) { Describe 'Set-JcSdkUserAssociation' -Tag:(""){ It 'SetExpanded' { $ParameterType = (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.FullName - (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | ForEach-Object { + # skip routingPolicy association for now + (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | Where-Object {$_ -notmatch "routing" } | ForEach-Object { { Set-JcSdkUserAssociation -Id:((Get-Variable -Name:("PesterTest$($_)")).Value.Id) -Op:('add') -Type:(Invoke-Expression "[$ParameterType]::$_".Replace('group','_group')) -UserId:($global:PesterTestUser.Id) } | Should -Not -Throw { Set-JcSdkUserAssociation -Id:((Get-Variable -Name:("PesterTest$($_)")).Value.Id) -Op:('remove') -Type:(Invoke-Expression "[$ParameterType]::$_".Replace('group','_group')) -UserId:($global:PesterTestUser.Id) } | Should -Not -Throw } @@ -25,7 +26,8 @@ Describe 'Set-JcSdkUserAssociation' -Tag:(""){ It 'Set' { $ParameterType = (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.FullName - (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | ForEach-Object { + # skip routingPolicy association for now + (Get-Command Set-JcSdkUserAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | Where-Object {$_ -notmatch "routing" } | ForEach-Object { { Set-JcSdkUserAssociation -Body:(@{Id = (Get-Variable -Name:("PesterTest$($_)")).Value.Id; Op = 'add'; Type = Invoke-Expression "[$ParameterType]::$_".Replace('group','_group'); }) -UserId:($global:PesterTestUser.Id) } | Should -Not -Throw { Set-JcSdkUserAssociation -Body:(@{Id = (Get-Variable -Name:("PesterTest$($_)")).Value.Id; Op = 'remove'; Type = Invoke-Expression "[$ParameterType]::$_".Replace('group','_group'); }) -UserId:($global:PesterTestUser.Id) } | Should -Not -Throw } diff --git a/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserGroupAssociation.Tests.ps1 b/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserGroupAssociation.Tests.ps1 index b1282afb4..989a64cad 100644 --- a/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserGroupAssociation.Tests.ps1 +++ b/SDKs/PowerShell/JumpCloud.SDK.V2/test/Set-JcSdkUserGroupAssociation.Tests.ps1 @@ -17,7 +17,8 @@ while(-not $mockingPath) { Describe 'Set-JcSdkUserGroupAssociation' -Tag:(""){ It 'SetExpanded' { $ParameterType = (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.FullName - (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | ForEach-Object { + # skip routingPolicy associations for now + (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | Where-Object {$_ -notmatch "routing" } | ForEach-Object { { Set-JcSdkUserGroupAssociation -Id:((Get-Variable -Name:("PesterTest$($_)")).Value.Id) -Op:('add') -Type:(Invoke-Expression "[$ParameterType]::$_".Replace('group','_group')) -GroupId:($global:PesterTestUserGroup.Id) } | Should -Not -Throw { Set-JcSdkUserGroupAssociation -Id:((Get-Variable -Name:("PesterTest$($_)")).Value.Id) -Op:('remove') -Type:(Invoke-Expression "[$ParameterType]::$_".Replace('group','_group')) -GroupId:($global:PesterTestUserGroup.Id) } | Should -Not -Throw } @@ -25,7 +26,8 @@ Describe 'Set-JcSdkUserGroupAssociation' -Tag:(""){ It 'Set' { $ParameterType = (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.FullName - (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | ForEach-Object { + # skip routingPolicy associations for now + (Get-Command Set-JcSdkUserGroupAssociation).Parameters.Type.ParameterType.DeclaredFields.Where( { $_.IsPublic }).Name | Where-Object {$_ -notmatch "routing" } | ForEach-Object { { Set-JcSdkUserGroupAssociation -Body:(@{Id = (Get-Variable -Name:("PesterTest$($_)")).Value.Id; Op = 'add'; Type = Invoke-Expression "[$ParameterType]::$_".Replace('group','_group'); }) -GroupId:($global:PesterTestUserGroup.Id) } | Should -Not -Throw { Set-JcSdkUserGroupAssociation -Body:(@{Id = (Get-Variable -Name:("PesterTest$($_)")).Value.Id; Op = 'remove'; Type = Invoke-Expression "[$ParameterType]::$_".Replace('group','_group'); }) -GroupId:($global:PesterTestUserGroup.Id) } | Should -Not -Throw }