Skip to content

Commit

Permalink
Connection(Tests): Add tests for client_credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Jan 21, 2020
1 parent b9588ba commit e3a97ac
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Tests/integration/Connection.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,33 @@ Describe "Connect to a ClearPass (using multi connection)" {

}

Describe "Connect using client_credentials" {
BeforeAll {
#connect...
Connect-ArubaCP $ipaddress -Token $token -SkipCertificateCheck -port $port
#Create a API Client with client credentials
Add-ArubaCPApiClient -client_id pester_PowerArubaCP -client_secret pester_MySecret -grant_types "client_credentials" -profile_id 1
}

It "Connect to a ClearPass (using client_credentials and store on cppm variable)" {
$script:cppm = Connect-ArubaCP $ipaddress -client_id pester_PowerArubaCP -client_secret pester_MySecret -SkipCertificateCheck -port $port -DefaultConnection:$false
$cppm.server | Should be $ipaddress
$cppm.token | Should not be BeNullOrEmpty
$cppm.port | Should be $port
}

It "Use Multi connection for call Get (Api Client)" {
{ Get-ArubaCPApiClient -connection $cppm } | Should Not throw
}

AfterAll {
#Remove API Client
Get-ArubaCPApiClient -client_id pester_PowerArubaCP | Remove-ArubaCPApiClient -noconfirm
#And disconnect
Disconnect-ArubaCP -noconfirm
}
}

Describe "Invoke ArubaCP RestMethod tests" {
BeforeAll {
#connect...
Expand Down

0 comments on commit e3a97ac

Please sign in to comment.