Skip to content

Commit

Permalink
Added query parameters to get back settled reservations
Browse files Browse the repository at this point in the history
  • Loading branch information
DCMattyG committed Aug 23, 2023
1 parent 55ccc0d commit 93d9bbd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/azureipam.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ BeforeAll {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True, Position=0)]
[string]$resource
[string]$resource,

[Parameter(Mandatory=$False, Position=1)]
[hashtable]$query
)

$response = Invoke-RestMethod `
-Method Get `
-Authentication Bearer `
-Token $accessToken `
-Uri "${baseUrl}${resource}" `
-Headers $headers
-Headers $headers `
-Body $query

Write-Output $response
}
Expand Down Expand Up @@ -421,11 +425,16 @@ Context 'Reservations' {

Start-Sleep -Seconds 180

$query = @{
settled = $true
}

$networks = Get-ApiResource '/spaces/TestSpaceA/blocks/TestBlockA/networks'
$reservations = Get-ApiResource '/spaces/TestSpaceA/blocks/TestBlockA/reservations'
$reservations = Get-ApiResource '/spaces/TestSpaceA/blocks/TestBlockA/reservations' $query

$($networks | Select-Object -ExpandProperty id) -contains $script:newNetA.Id | Should -Be $true
$($networks | Select-Object -ExpandProperty id) -contains $script:newNetC.Id | Should -Be $true
$reservations | Should -Not -Be $null
$reservations[0].SettledOn -eq $null | Should -Be $false
$reservations[0].Status -eq "fulfilled" | Should -Be $true
}
Expand Down

0 comments on commit 93d9bbd

Please sign in to comment.