TT#9309 Adapt ngcp-panel tests to api forcearray

Change-Id: I1a5fcfe36f536d6306c1dce58f18ba0a39812521
changes/24/12424/1
Irina Peshinskaya 9 years ago
parent 35bac73d19
commit 7198802a1b

@ -207,10 +207,10 @@ my @allcontracts = ();
# remove any contact we find in the collection for later check
if(ref $collection->{_links}->{'ngcp:contracts'} eq "HASH") {
# TODO: handle hashref
ok($collection->{_embedded}->{'ngcp:contracts'}->{status} ne "terminated", "check if we don't have terminated contracts in response");
ok($collection->{_embedded}->{'ngcp:contracts'}->{type} eq "sippeering" || $collection->{_embedded}->{'ngcp:contracts'}->{type} eq "reseller", "check for correct system contract type");
ok(exists $collection->{_embedded}->{'ngcp:contracts'}->{_links}->{'ngcp:systemcontacts'}, "check presence of ngcp:systemcontacts relation");
ok(exists $collection->{_embedded}->{'ngcp:contracts'}->{_links}->{'ngcp:billingprofiles'}, "check presence of ngcp:billingprofiles relation");
ok($collection->{_embedded}->{'ngcp:contracts'}->[0]->{status} ne "terminated", "check if we don't have terminated contracts in response");
ok($collection->{_embedded}->{'ngcp:contracts'}->[0]->{type} eq "sippeering" || $collection->{_embedded}->{'ngcp:contracts'}->[0]->{type} eq "reseller", "check for correct system contract type");
ok(exists $collection->{_embedded}->{'ngcp:contracts'}->[0]->{_links}->{'ngcp:systemcontacts'}, "check presence of ngcp:systemcontacts relation");
ok(exists $collection->{_embedded}->{'ngcp:contracts'}->[0]->{_links}->{'ngcp:billingprofiles'}, "check presence of ngcp:billingprofiles relation");
delete $contracts{$collection->{_links}->{'ngcp:contracts'}->{href}};
} else {
foreach my $c(@{ $collection->{_links}->{'ngcp:contracts'} }) {

@ -225,11 +225,11 @@ my @allcustomers = ();
# remove any contact we find in the collection for later check
if(ref $collection->{_links}->{'ngcp:customers'} eq "HASH") {
ok($collection->{_embedded}->{'ngcp:customers'}->{type} eq "sipaccount" || $collection->{_embedded}->{'ngcp:customers'}->{type} eq "pbxaccount", "check for correct customer contract type");
ok($collection->{_embedded}->{'ngcp:customers'}->{status} ne "terminated", "check if we don't have terminated customers in response");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->{_links}->{'ngcp:customercontacts'}, "check presence of ngcp:customercontacts relation");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->{_links}->{'ngcp:billingprofiles'}, "check presence of ngcp:billingprofiles relation");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->{_links}->{'ngcp:customerbalances'}, "check presence of ngcp:customerbalances relation");
ok($collection->{_embedded}->{'ngcp:customers'}->[0]->{type} eq "sipaccount" || $collection->{_embedded}->{'ngcp:customers'}->[0]->{type} eq "pbxaccount", "check for correct customer contract type");
ok($collection->{_embedded}->{'ngcp:customers'}->[0]->{status} ne "terminated", "check if we don't have terminated customers in response");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->[0]->{_links}->{'ngcp:customercontacts'}, "check presence of ngcp:customercontacts relation");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->[0]->{_links}->{'ngcp:billingprofiles'}, "check presence of ngcp:billingprofiles relation");
ok(exists $collection->{_embedded}->{'ngcp:customers'}->[0]->{_links}->{'ngcp:customerbalances'}, "check presence of ngcp:customerbalances relation");
delete $customers{$collection->{_links}->{'ngcp:customers'}->{href}};
} else {
foreach my $c(@{ $collection->{_links}->{'ngcp:customers'} }) {

Loading…
Cancel
Save