* Migrated all basic test cases from old test framework * Further improvements to test framework Change-Id: I60fd97903e56bc2f69c02ca5c0193472fd7139ecchanges/11/32611/8
parent
a114ff9d24
commit
b3cd55fdd1
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for bannedips
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/bannedips/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-bannedips
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/bannedips/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,29 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for bannedusers
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/bannedusers/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-bannedusers
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/bannedusers/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,193 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for billingfees
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/billingfees/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-billingfees
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create billingfees
|
||||
-
|
||||
name: create billingfees
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingfees/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
billing_zone_id: 1
|
||||
destination: '^1234'
|
||||
direction: out
|
||||
onpeak_init_rate: 1
|
||||
onpeak_init_interval: 60
|
||||
onpeak_follow_rate: 1
|
||||
onpeak_follow_interval: 30
|
||||
offpeak_init_rate: 0.5
|
||||
offpeak_init_interval: 60
|
||||
offpeak_follow_rate: 0.5
|
||||
offpeak_follow_interval: 30
|
||||
retain:
|
||||
billingfees_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingfees
|
||||
-
|
||||
name: create billingfees
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingfees/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
billing_zone_id: 1
|
||||
destination: '^4567'
|
||||
direction: out
|
||||
onpeak_init_rate: 1
|
||||
onpeak_init_interval: 60
|
||||
onpeak_follow_rate: 1
|
||||
onpeak_follow_interval: 30
|
||||
offpeak_init_rate: 0.5
|
||||
offpeak_init_interval: 60
|
||||
offpeak_follow_rate: 0.5
|
||||
offpeak_follow_interval: 30
|
||||
retain:
|
||||
billingfees_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingfees
|
||||
-
|
||||
name: create billingfees
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingfees/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
billing_zone_id: 1
|
||||
destination: '^8901'
|
||||
direction: out
|
||||
onpeak_init_rate: 1
|
||||
onpeak_init_interval: 60
|
||||
onpeak_follow_rate: 1
|
||||
onpeak_follow_interval: 30
|
||||
offpeak_init_rate: 0.5
|
||||
offpeak_init_interval: 60
|
||||
offpeak_follow_rate: 0.5
|
||||
offpeak_follow_interval: 30
|
||||
retain:
|
||||
billingfees_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/billingfees/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get billingfees
|
||||
-
|
||||
name: GET billingfees
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${billingfees_path3}'
|
||||
retain:
|
||||
billingfees: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{billingfees}->{_links};
|
||||
delete $retained->{billingfees}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put billingfees
|
||||
-
|
||||
name: PUT billingfees
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingfees_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${billingfees}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get billingfees
|
||||
-
|
||||
name: GET billingfees
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${billingfees_path3}'
|
||||
retain:
|
||||
new_billingfees: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_billingfees}->{_links};
|
||||
delete $retained->{new_billingfees}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${billingfees}': ${new_billingfees}
|
||||
|
||||
#DELETE billingfees
|
||||
-
|
||||
name: DELETE billingfees
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingfees_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE billingfees
|
||||
-
|
||||
name: DELETE billingfees
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingfees_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE billingfees
|
||||
-
|
||||
name: DELETE billingfees
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingfees_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,536 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for billingprofiles
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/billingprofiles/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-billingprofiles
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: testapihandle1${unique_id}
|
||||
name: test api name 1 ${unique_id}
|
||||
retain:
|
||||
billingprofile_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: testapihandle2${unique_id}
|
||||
name: test api name 2 ${unique_id}
|
||||
retain:
|
||||
billingprofile_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: testapihandle3${unique_id}
|
||||
name: test api name 3 ${unique_id}
|
||||
retain:
|
||||
billingprofile_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/billingprofiles/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create billingprofile without reseller id
|
||||
-
|
||||
name: create billingprofile without reseller id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
handle: testapihandle
|
||||
name: test api name
|
||||
retain:
|
||||
billingprofiles_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='reseller_id'
|
||||
|
||||
#create billingprofile with empty reseller id
|
||||
-
|
||||
name: create billingprofiles with empty reseller id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: null
|
||||
handle: testapihandle
|
||||
name: test api name
|
||||
retain:
|
||||
billingprofiles_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='reseller_id'
|
||||
|
||||
#create billingprofile with invalid reseller id
|
||||
-
|
||||
name: create billingprofile with invalid reseller id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 99999
|
||||
handle: testapihandle
|
||||
name: test api name
|
||||
retain:
|
||||
billingprofiles_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: Invalid reseller
|
||||
|
||||
#check options for item
|
||||
-
|
||||
name: check OPTIONS for billingprofiles item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /${billingprofile_path1}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get billingprofile
|
||||
-
|
||||
name: GET billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: /${billingprofile_path1}
|
||||
retain:
|
||||
billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{billingprofile}->{_links};
|
||||
delete $retained->{billingprofile}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${billingprofile}.reseller_id': defined
|
||||
'${billingprofile}.handle': defined
|
||||
'${billingprofile}.name': defined
|
||||
|
||||
#put billingprofile with missing content-type
|
||||
-
|
||||
name: PUT billingprofile with missing content-type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put billingprofile with unsupported content type
|
||||
-
|
||||
name: PUT billingprofile with unsupported Content-Type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/xxx
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put billingprofile with missing body
|
||||
-
|
||||
name: PUT billingprofile with missing body
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
|
||||
#put billingprofile
|
||||
-
|
||||
name: PUT billingprofile
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${billingprofile}'
|
||||
retain:
|
||||
new_billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_billingprofile}->{_links};
|
||||
delete $retained->{new_billingprofile}->{_embedded};
|
||||
$retained->{patched_name} = 'patched name '.$retained->{unique_id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${billingprofile}': ${new_billingprofile}
|
||||
|
||||
#PATCH billingprofile name
|
||||
-
|
||||
name: PATCH billingprofile name
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /name
|
||||
value: patched name ${unique_id}
|
||||
retain:
|
||||
modified_billingprofile: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${modified_billingprofile}.name': ${patched_name}
|
||||
'${modified_billingprofile}._links.self.href': ${billingprofile_path1}
|
||||
'${modified_billingprofile}._links.collection.href': /api/billingprofiles/
|
||||
|
||||
#check patch with undef reseller
|
||||
-
|
||||
name: check patch with undef reseller
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /reseller_id
|
||||
value: null
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check patch with invalid reseller
|
||||
-
|
||||
name: check patch with invalid reseller
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /reseller_id
|
||||
value: 99999
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check patch prepaid
|
||||
-
|
||||
name: check patch prepaid
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${billingprofile_path1}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /prepaid
|
||||
value: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE billingprofile
|
||||
-
|
||||
name: DELETE billingprofile
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingprofile_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get terminated billingprofile
|
||||
-
|
||||
name: GET terminated billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: /${billingprofile_path1}
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
|
||||
#create peaktimes weekday billing profile
|
||||
-
|
||||
name: create peaktimes weekday billing profile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: peakweekdays${unique_id}
|
||||
name: peak week days ${unique_id}
|
||||
peaktime_weekdays:
|
||||
-
|
||||
weekday: 1
|
||||
start: '8:00'
|
||||
stop: '10:00'
|
||||
-
|
||||
weekday: 1
|
||||
start: '10:01'
|
||||
stop: '12:00'
|
||||
-
|
||||
weekday: 2
|
||||
start: '10:00'
|
||||
stop: '12:00'
|
||||
retain:
|
||||
peaktimes_weekday_billingprofile_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get POSTed billingprofile
|
||||
-
|
||||
name: GET POSTed billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: /${peaktimes_weekday_billingprofile_path}
|
||||
retain:
|
||||
peaktimes_weekday_billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peaktimes_weekday_billingprofile}->{_links};
|
||||
delete $retained->{peaktimes_weekday_billingprofile}->{_embedded};
|
||||
$retained->{malformed_profile} = {%{$retained->{peaktimes_weekday_billingprofile}}};
|
||||
$retained->{malformed_profile}->{peaktime_weekdays} = [
|
||||
{ weekday => 1,
|
||||
start => '08:00',
|
||||
stop => '10:00',
|
||||
},
|
||||
{ weekday => 1,
|
||||
start => '10:00',
|
||||
stop => '12:00',
|
||||
},
|
||||
];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put malformed billingprofile
|
||||
-
|
||||
name: PUT malformed billingprofile
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peaktimes_weekday_billingprofile_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${malformed_profile}'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
like:
|
||||
body.message: overlap
|
||||
|
||||
#put billingprofile
|
||||
-
|
||||
name: PUT billingprofile
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peaktimes_weekday_billingprofile_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peaktimes_weekday_billingprofile}'
|
||||
retain:
|
||||
new_billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_billingprofile}->{_links};
|
||||
delete $retained->{new_billingprofile}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peaktimes_weekday_billingprofile}': ${new_billingprofile}
|
||||
|
||||
#create peaktimes special billing profile
|
||||
-
|
||||
name: create peaktimes special billing profile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: peakspecials${unique_id}
|
||||
name: peak specials ${unique_id}
|
||||
peaktime_special:
|
||||
-
|
||||
start: '2016-01-01 08:00:00'
|
||||
stop: '2016-01-02 07:59:59'
|
||||
-
|
||||
start: '2016-01-02 08:00:00'
|
||||
stop: '2016-01-02 10:00:00'
|
||||
retain:
|
||||
peaktimes_special_billingprofile_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get POSTed billingprofile
|
||||
-
|
||||
name: GET POSTed billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: /${peaktimes_special_billingprofile_path}
|
||||
retain:
|
||||
peaktimes_special_billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peaktimes_special_billingprofile}->{_links};
|
||||
delete $retained->{peaktimes_special_billingprofile}->{_embedded};
|
||||
$retained->{malformed_profile} = {%{$retained->{peaktimes_special_billingprofile}}};
|
||||
$retained->{malformed_profile}->{peaktime_special} = [
|
||||
{ start => '2016-01-01 08:00:00',
|
||||
stop => '2016-01-02 08:00:00',
|
||||
},
|
||||
{ start => '2016-01-02 08:00:00',
|
||||
stop => '2016-01-02 08:00:01',
|
||||
},
|
||||
];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put malformed billingprofile
|
||||
-
|
||||
name: PUT malformed billingprofile
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peaktimes_special_billingprofile_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${malformed_profile}'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
like:
|
||||
body.message: overlap
|
||||
|
||||
#put billingprofile
|
||||
-
|
||||
name: PUT billingprofile
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peaktimes_special_billingprofile_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peaktimes_special_billingprofile}'
|
||||
retain:
|
||||
new_billingprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_billingprofile}->{_links};
|
||||
delete $retained->{new_billingprofile}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peaktimes_special_billingprofile}': ${new_billingprofile}
|
||||
@ -0,0 +1,166 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for billingzones
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/billingzones/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-billingzones
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create billingzones
|
||||
-
|
||||
name: create billingzones
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingzones/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
zone: apitestzone1${unique_id}
|
||||
detail: api_test zone
|
||||
retain:
|
||||
billingzones_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingzones
|
||||
-
|
||||
name: create billingzones
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingzones/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
zone: apitestzone2${unique_id}
|
||||
detail: api_test zone
|
||||
retain:
|
||||
billingzones_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create billingzones
|
||||
-
|
||||
name: create billingzones
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingzones/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
billing_profile_id: 1
|
||||
zone: apitestzone3${unique_id}
|
||||
detail: api_test zone
|
||||
retain:
|
||||
billingzones_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/billingzones/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get billingzones
|
||||
-
|
||||
name: GET billingzones
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${billingzones_path3}'
|
||||
retain:
|
||||
billingzones: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{billingzones}->{_links};
|
||||
delete $retained->{billingzones}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put billingzones
|
||||
-
|
||||
name: PUT billingzones
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${billingzones_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${billingzones}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get billingzones
|
||||
-
|
||||
name: GET billingzones
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${billingzones_path3}'
|
||||
retain:
|
||||
new_billingzones: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_billingzones}->{_links};
|
||||
delete $retained->{new_billingzones}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${billingzones}': ${new_billingzones}
|
||||
|
||||
#DELETE billingzones
|
||||
-
|
||||
name: DELETE billingzones
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingzones_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE billingzones
|
||||
-
|
||||
name: DELETE billingzones
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingzones_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE billingzones
|
||||
-
|
||||
name: DELETE billingzones
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${billingzones_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,214 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for cfdestinationsets
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/cfdestinationsets/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-cfdestinationsets
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#get a subscriber for testing
|
||||
-
|
||||
name: get a subscriber for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1'
|
||||
retain:
|
||||
subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriber = $retained->{subscriber}->{'_embedded'}->{'ngcp:subscribers'}->[0];
|
||||
$retained->{subscriber} = $subscriber;
|
||||
$retained->{subscriber_id} = $subscriber->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriber}.id': defined
|
||||
|
||||
#create cfdestinationsets
|
||||
-
|
||||
name: create cfdestinationsets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/cfdestinationsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
name: Weekend days 1
|
||||
destinations:
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
announcement_id: 255
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
retain:
|
||||
cfdestinationsets_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create cfdestinationsets
|
||||
-
|
||||
name: create cfdestinationsets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/cfdestinationsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
name: Weekend days 2
|
||||
destinations:
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
announcement_id: 255
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
retain:
|
||||
cfdestinationsets_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create cfdestinationsets
|
||||
-
|
||||
name: create cfdestinationsets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/cfdestinationsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
name: Weekend days 2
|
||||
destinations:
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
announcement_id: 255
|
||||
-
|
||||
destination: customhours
|
||||
priority: 1
|
||||
timeout: 300
|
||||
retain:
|
||||
cfdestinationsets_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/cfdestinationsets/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get cfdestinationsets
|
||||
-
|
||||
name: GET cfdestinationsets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${cfdestinationsets_path3}'
|
||||
retain:
|
||||
cfdestinationsets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{cfdestinationsets}->{_links};
|
||||
delete $retained->{cfdestinationsets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put cfdestinationsets
|
||||
-
|
||||
name: PUT cfdestinationsets
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${cfdestinationsets_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${cfdestinationsets}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get cfdestinationsets
|
||||
-
|
||||
name: GET cfdestinationsets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${cfdestinationsets_path3}'
|
||||
retain:
|
||||
new_cfdestinationsets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_cfdestinationsets}->{_links};
|
||||
delete $retained->{new_cfdestinationsets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${cfdestinationsets}': ${new_cfdestinationsets}
|
||||
|
||||
#DELETE cfdestinationsets
|
||||
-
|
||||
name: DELETE cfdestinationsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${cfdestinationsets_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE cfdestinationsets
|
||||
-
|
||||
name: DELETE cfdestinationsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${cfdestinationsets_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE cfdestinationsets
|
||||
-
|
||||
name: DELETE cfdestinationsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${cfdestinationsets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,173 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for cftimesets
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/cftimesets/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-cftimesets
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#get a subscriber for testing
|
||||
-
|
||||
name: get a subscriber for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1'
|
||||
retain:
|
||||
subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriber = $retained->{subscriber}->{'_embedded'}->{'ngcp:subscribers'}->[0];
|
||||
$retained->{subscriber} = $subscriber;
|
||||
$retained->{subscriber_id} = $subscriber->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriber}.id': defined
|
||||
|
||||
#create cftimesets
|
||||
-
|
||||
name: create cftimesets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/cftimesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
name: API_test call forward time-set
|
||||
times:
|
||||
-
|
||||
wday: '1-5'
|
||||
hour: '5-5'
|
||||
minute: '50-59'
|
||||
year: null
|
||||
month: null
|
||||
mday: null
|
||||
retain:
|
||||
cftimesets_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/cftimesets/?page=1&rows=1'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get cftimesets
|
||||
-
|
||||
name: GET cftimesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${cftimesets_path1}'
|
||||
retain:
|
||||
cftimesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{cftimesets}->{_links};
|
||||
delete $retained->{cftimesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put cftimesets
|
||||
-
|
||||
name: PUT cftimesets
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${cftimesets_path1}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${cftimesets}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get cftimesets
|
||||
-
|
||||
name: GET cftimesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${cftimesets_path1}'
|
||||
retain:
|
||||
new_cftimesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_cftimesets}->{_links};
|
||||
delete $retained->{new_cftimesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${cftimesets}': ${new_cftimesets}
|
||||
|
||||
#create cftimesets with cyclic wday
|
||||
-
|
||||
name: create cftimesets with cyclic wday
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/cftimesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
name: API_test call forward time-set
|
||||
times:
|
||||
-
|
||||
wday: '6-1'
|
||||
hour: '5-5'
|
||||
minute: '50-59'
|
||||
year: null
|
||||
month: null
|
||||
mday: null
|
||||
retain:
|
||||
cftimesets_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#DELETE cftimesets
|
||||
-
|
||||
name: DELETE cftimesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${cftimesets_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE cftimesets
|
||||
-
|
||||
name: DELETE cftimesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${cftimesets_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,138 @@
|
||||
---
|
||||
#get a subscriber for testing
|
||||
-
|
||||
name: get a subscriber for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1'
|
||||
retain:
|
||||
subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriber = $retained->{subscriber}->{'_embedded'}->{'ngcp:subscribers'}->[0];
|
||||
$retained->{subscriber} = $subscriber;
|
||||
$retained->{subscriber_id} = $subscriber->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriber}.id': defined
|
||||
|
||||
#get call lists for subscriber
|
||||
-
|
||||
name: get call lists for subscriber
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&subscriber_id=${subscriber_id}'
|
||||
retain:
|
||||
calllists: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for subscriber with direction in
|
||||
-
|
||||
name: get call lists for subscriber with direction in
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&direction=in&subscriber_id=${subscriber_id}'
|
||||
retain:
|
||||
calllists_in: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for subscriber with direction out
|
||||
-
|
||||
name: get call lists for subscriber with direction out
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&direction=out&subscriber_id=${subscriber_id}'
|
||||
retain:
|
||||
calllists_out: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for subscriber with rating_status filter ok
|
||||
-
|
||||
name: get call lists for subscriber with rating_status filter ok
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&rating_status=ok&subscriber_id=${subscriber_id}'
|
||||
retain:
|
||||
calllists_ok: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for subscriber with rating_status filter unrated,failed
|
||||
-
|
||||
name: get call lists for subscriber with rating_status filter unrated,failed
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&rating_status=unrated,failed&subscriber_id=${subscriber_id}'
|
||||
retain:
|
||||
calllists_unrated_failed: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get a customer for testing
|
||||
-
|
||||
name: get a customer for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/customers/?page=1&rows=1'
|
||||
retain:
|
||||
customer: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $customer = $retained->{customer}->{'_embedded'}->{'ngcp:customers'}->[0];
|
||||
$retained->{customer} = $customer;
|
||||
$retained->{customer_id} = $customer->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${customer}.id': defined
|
||||
|
||||
#get call lists for customer
|
||||
-
|
||||
name: get call lists for customer
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&customer_id=${customer_id}'
|
||||
retain:
|
||||
calllists: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for customer with direction in
|
||||
-
|
||||
name: get call lists for customer with direction in
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&direction=in&customer_id=${customer_id}'
|
||||
retain:
|
||||
calllists_in: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get call lists for customer with direction out
|
||||
-
|
||||
name: get call lists for customer with direction out
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/calllists/?page=1&rows=10&direction=out&customer_id=${customer_id}'
|
||||
retain:
|
||||
calllists_out: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,338 @@
|
||||
---
|
||||
#get a subscriber for testing
|
||||
-
|
||||
name: get a subscriber for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1'
|
||||
retain:
|
||||
subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriber = $retained->{subscriber}->{'_embedded'}->{'ngcp:subscribers'}->[0];
|
||||
$retained->{subscriber} = $subscriber;
|
||||
$retained->{subscriber_id} = $subscriber->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriber}.id': defined
|
||||
|
||||
#get a customer for testing
|
||||
-
|
||||
name: get a customer for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/customers/?page=1&rows=1'
|
||||
retain:
|
||||
customer: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $customer = $retained->{customer}->{'_embedded'}->{'ngcp:customers'}->[0];
|
||||
$retained->{customer} = $customer;
|
||||
$retained->{customer_id} = $customer->{id};
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=call&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${customer}.id': defined
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=call&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=voicemail&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=voicemail&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=fax&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=fax&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=sms&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=sms&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=xmpp&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?customer_id=".$retained->{customer_id}."&type=xmpp&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=call&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=call&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=voicemail&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=voicemail&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=fax&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=fax&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=sms&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=sms&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=xmpp&order_by=type";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/conversations/?subscriber_id=".$retained->{subscriber_id}."&type=xmpp&order_by=timestamp";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get conversations
|
||||
-
|
||||
name: get conversations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,505 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for customercontacts
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/customercontacts/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-customercontacts
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create customercontact
|
||||
-
|
||||
name: create customercontact
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_1_${unique_id}
|
||||
lastname: Test_Last_1_${unique_id}
|
||||
email: test_1_.${unique_id}@test.invalid
|
||||
reseller_id: 1
|
||||
retain:
|
||||
customercontact1_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create customercontact
|
||||
-
|
||||
name: create customercontact
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_2_${unique_id}
|
||||
lastname: Test_Last_2_${unique_id}
|
||||
email: test_2_.${unique_id}@test.invalid
|
||||
reseller_id: 1
|
||||
retain:
|
||||
customercontact2_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create customercontact
|
||||
-
|
||||
name: create customercontact
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_3_${unique_id}
|
||||
lastname: Test_Last_3_${unique_id}
|
||||
email: test_3_.${unique_id}@test.invalid
|
||||
reseller_id: 1
|
||||
retain:
|
||||
customercontact3_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/customercontacts/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create contact without email
|
||||
-
|
||||
name: create contact without email
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_invalid
|
||||
lastname: Test_Last_invalid
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='email'
|
||||
|
||||
#create contact without reseller_id
|
||||
-
|
||||
name: create contact without reseller_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_invalid
|
||||
lastname: Test_Last_invalid
|
||||
email: test_invalid@test.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='reseller_id'
|
||||
|
||||
#create contact with invalid reseller_id
|
||||
-
|
||||
name: create contact with invalid reseller_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: Test_First_invalid
|
||||
lastname: Test_Last_invalid
|
||||
email: test_invalid@test.invalid
|
||||
reseller_id: 99999
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: Invalid 'reseller_id'
|
||||
|
||||
#check options for item
|
||||
-
|
||||
name: check OPTIONS for customercontacts item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /${customercontact1_path}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get customercontact
|
||||
-
|
||||
name: GET customercontact
|
||||
type: item
|
||||
method: GET
|
||||
path: /${customercontact1_path}
|
||||
retain:
|
||||
customercontact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{customercontact}->{_links};
|
||||
delete $retained->{customercontact}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${customercontact}.firstname': defined
|
||||
'${customercontact}.lastname': defined
|
||||
'${customercontact}.email': defined
|
||||
like:
|
||||
'${customercontact}.id': '[0-9]+'
|
||||
'${customercontact}.reseller_id': '[0-9]+'
|
||||
|
||||
#put customercontact with missing content-type
|
||||
-
|
||||
name: PUT customercontact with missing content-type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put customercontact with unsupported content type
|
||||
-
|
||||
name: PUT customercontact with unsupported Content-Type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/xxx
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put customercontact with missing body
|
||||
-
|
||||
name: PUT customercontact with missing body
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
|
||||
#put customercontact
|
||||
-
|
||||
name: PUT customercontact
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${customercontact}'
|
||||
retain:
|
||||
new_customercontact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_customercontact}->{_links};
|
||||
delete $retained->{new_customercontact}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${customercontact}': ${new_customercontact}
|
||||
|
||||
#PATCH customercontact firstname
|
||||
-
|
||||
name: PATCH customercontact firstname
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /firstname
|
||||
value: patchedfirst
|
||||
retain:
|
||||
modified_customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${modified_customercontact}.firstname': patchedfirst
|
||||
|
||||
#PATCH customercontact firstname
|
||||
-
|
||||
name: PATCH customercontact firstname
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /firstname
|
||||
value: null
|
||||
retain:
|
||||
modified_customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${modified_customercontact}.firstname': undefined
|
||||
|
||||
#PATCH customercontact with undefined email
|
||||
-
|
||||
name: PATCH customercontact with undefined email
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /email
|
||||
value: null
|
||||
retain:
|
||||
modified_customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH customercontact with undefined reseller_id
|
||||
-
|
||||
name: PATCH customercontact with undefined reseller_id
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /reseller_id
|
||||
value: null
|
||||
retain:
|
||||
modified_customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH customercontact with invalid reseller_id
|
||||
-
|
||||
name: PATCH customercontact with invalid reseller_id
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customercontact1_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /reseller_id
|
||||
value: 99999
|
||||
retain:
|
||||
modified_customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#DELETE customercontact
|
||||
-
|
||||
name: DELETE customercontact
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${customercontact1_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#create test domain
|
||||
-
|
||||
name: create test domain
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/domains/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: test${unique_id}.example.org
|
||||
reseller_id: 1
|
||||
retain:
|
||||
domain_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get test domain
|
||||
-
|
||||
name: get test domain
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${domain_path}'
|
||||
retain:
|
||||
domain: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create test billingprofile
|
||||
-
|
||||
name: create test billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test profile ${unique_id}
|
||||
handle: testprofile${unique_id}
|
||||
reseller_id: 1
|
||||
retain:
|
||||
billingprofile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create CustomerContact
|
||||
-
|
||||
name: include create CustomerContact
|
||||
type: include
|
||||
file: CreateCustomerContact.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
$retained->{customercontact_content} = {
|
||||
firstname => "cust_contact_first",
|
||||
lastname => "cust_contact_last",
|
||||
email => "cust_contact\@custcontact.invalid",
|
||||
reseller_id => 1,
|
||||
};
|
||||
}
|
||||
|
||||
#create Customer
|
||||
-
|
||||
name: include create Customer
|
||||
type: include
|
||||
file: CreateCustomer.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{subscriber_map} = ();
|
||||
$retained->{customer_map} = ();
|
||||
|
||||
$retained->{customer_content} = {
|
||||
status => 'active',
|
||||
contact_id => $retained->{customercontact_id},
|
||||
billing_profile_id => $retained->{billingprofile_id},
|
||||
type => 'sipaccount',
|
||||
max_subscribers => undef,
|
||||
external_id => undef
|
||||
};
|
||||
}
|
||||
|
||||
#DELETE customercontact
|
||||
-
|
||||
name: DELETE customercontact
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${customercontact_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 423
|
||||
|
||||
#get customercontact
|
||||
-
|
||||
name: get customercontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customercontact_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#PATCH customer status
|
||||
-
|
||||
name: PATCH customer status
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${customer_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /status
|
||||
value: terminated
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE customercontact
|
||||
-
|
||||
name: DELETE customercontact
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${customercontact_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get customercontact
|
||||
-
|
||||
name: get customercontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customercontact_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
@ -0,0 +1,57 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for domains
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/domains/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-domains
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create domain
|
||||
-
|
||||
name: create domain
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/domains/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: api_test.api_test${unique_id}
|
||||
reseller_id: 1
|
||||
retain:
|
||||
domain_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/domains/?page=1&rows=1'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE domain
|
||||
-
|
||||
name: DELETE domain
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${domain_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,172 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for emailtemplates
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/emailtemplates/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-emailtemplates
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create emailtemplates
|
||||
-
|
||||
name: create emailtemplates
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/emailtemplates/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_email_template_name1'
|
||||
from_email: 'api_test1@api-test.email.com'
|
||||
subject: 'api_test email template 1'
|
||||
body: 'api_test email template 1: a lot of the text here'
|
||||
retain:
|
||||
emailtemplates_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create emailtemplates
|
||||
-
|
||||
name: create emailtemplates
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/emailtemplates/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_email_template_name2'
|
||||
from_email: 'api_test2@api-test.email.com'
|
||||
subject: 'api_test email template 2'
|
||||
body: 'api_test email template 2: a lot of the text here'
|
||||
retain:
|
||||
emailtemplates_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create emailtemplates
|
||||
-
|
||||
name: create emailtemplates
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/emailtemplates/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_email_template_name3'
|
||||
from_email: 'api_test3@api-test.email.com'
|
||||
subject: 'api_test email template 3'
|
||||
body: 'api_test email template 3: a lot of the text here'
|
||||
retain:
|
||||
emailtemplates_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/emailtemplates/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get emailtemplates
|
||||
-
|
||||
name: GET emailtemplates
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${emailtemplates_path3}'
|
||||
retain:
|
||||
emailtemplates: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{emailtemplates}->{_links};
|
||||
delete $retained->{emailtemplates}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put emailtemplates
|
||||
-
|
||||
name: PUT emailtemplates
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${emailtemplates_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${emailtemplates}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get emailtemplates
|
||||
-
|
||||
name: GET emailtemplates
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${emailtemplates_path3}'
|
||||
retain:
|
||||
new_emailtemplates: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_emailtemplates}->{_links};
|
||||
delete $retained->{new_emailtemplates}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${emailtemplates}': ${new_emailtemplates}
|
||||
|
||||
#DELETE emailtemplates
|
||||
-
|
||||
name: DELETE emailtemplates
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${emailtemplates_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE emailtemplates
|
||||
-
|
||||
name: DELETE emailtemplates
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${emailtemplates_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE emailtemplates
|
||||
-
|
||||
name: DELETE emailtemplates
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${emailtemplates_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,376 @@
|
||||
---
|
||||
#create test domain
|
||||
-
|
||||
name: create test domain
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/domains/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: test${unique_id}.example.org
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
domain_path: header.location
|
||||
domain_id: header.location
|
||||
|
||||
#create a BillingProfile
|
||||
-
|
||||
name: create a BillingProfile
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/billingprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test profile ${unique_id}
|
||||
handle: test_profile_handle${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
|
||||
#create SubscriberProfileSet 1
|
||||
-
|
||||
name: create SubscriberProfileSet 1
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofilesets/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_1_set_${unique_id}
|
||||
description: subscriber_profile_1_set_description_${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_set_1_path: header.location
|
||||
subscriber_profile_set_1_id: header.location
|
||||
|
||||
#get SubscriberProfileSet 1
|
||||
-
|
||||
name: get SubscriberProfileSet 1
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_set_1_path}'
|
||||
retain:
|
||||
subscriber_profile_set_1: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create SubscriberProfileSet 2
|
||||
-
|
||||
name: create SubscriberProfileSet 2
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofilesets/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_2_set_${unique_id}
|
||||
description: subscriber_profile_2_set_description_${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_set_2_path: header.location
|
||||
subscriber_profile_set_2_id: header.location
|
||||
|
||||
#get SubscriberProfileSet 2
|
||||
-
|
||||
name: get SubscriberProfileSet 2
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_set_2_path}'
|
||||
retain:
|
||||
subscriber_profile_set_2: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create SubscriberProfileSet 3
|
||||
-
|
||||
name: create SubscriberProfileSet 3
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofilesets/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_3_set_${unique_id}
|
||||
description: subscriber_profile_3_set_description_${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_set_3_path: header.location
|
||||
subscriber_profile_set_3_id: header.location
|
||||
|
||||
#get SubscriberProfileSet
|
||||
-
|
||||
name: get SubscriberProfileSet
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_set_3_path}'
|
||||
retain:
|
||||
subscriber_profile_set_3: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get SubscriberPreferenceDefs
|
||||
-
|
||||
name: get SubscriberPreferenceDefs
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberpreferencedefs/'
|
||||
retain:
|
||||
subscriber_preference_defs: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
foreach my $attr (keys %{$retained->{subscriber_preference_defs}}) {
|
||||
push(@{$retained->{subscriber_profile_attributes}},$attr);
|
||||
}
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create SubscriberProfile 1
|
||||
-
|
||||
name: create SubscriberProfile 1
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_1_${unique_id}
|
||||
description: subscriber_profile_1_description_${unique_id}
|
||||
profile_set_id: ${subscriber_profile_set_1_id}
|
||||
attributes: ${subscriber_profile_attributes}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_1_path: header.location
|
||||
|
||||
#get SubscriberProfileSet 1
|
||||
-
|
||||
name: get SubscriberProfile 1
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_1_path}'
|
||||
retain:
|
||||
subscriber_profile_1: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create SubscriberProfile 2
|
||||
-
|
||||
name: create SubscriberProfile 2
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_2_${unique_id}
|
||||
description: subscriber_profile_2_description_${unique_id}
|
||||
profile_set_id: ${subscriber_profile_set_2_id}
|
||||
attributes: ${subscriber_profile_attributes}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_2_path: header.location
|
||||
|
||||
#get SubscriberProfileSet 2
|
||||
-
|
||||
name: get SubscriberProfile 2
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_2_path}'
|
||||
retain:
|
||||
subscriber_profile_2: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create SubscriberProfile 3
|
||||
-
|
||||
name: create SubscriberProfile 3
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/subscriberprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: subscriber_profile_3_${unique_id}
|
||||
description: subscriber_profile_3_description_${unique_id}
|
||||
profile_set_id: ${subscriber_profile_set_3_id}
|
||||
attributes: ${subscriber_profile_attributes}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
subscriber_profile_3_path: header.location
|
||||
|
||||
#get SubscriberProfileSet 3
|
||||
-
|
||||
name: get SubscriberProfile 3
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_profile_3_path}'
|
||||
retain:
|
||||
subscriber_profile_3: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create a Customer Contact
|
||||
-
|
||||
name: create a Customer Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/customercontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: cust_contact_first
|
||||
lastname: cust_contact_last
|
||||
email: cust_contact@custcontact.invalid
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
customer_contact_path: header.location
|
||||
customer_contact_id: header.location
|
||||
|
||||
#get CustomerContact
|
||||
-
|
||||
name: check CustomerContact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_contact_path}'
|
||||
retain:
|
||||
customer_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_type} = 'sipaccount';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create Customer
|
||||
-
|
||||
name: include create Customer
|
||||
type: include
|
||||
file: CreateCustomer.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{subscriber_map} = ();
|
||||
$retained->{customer_map} = ();
|
||||
|
||||
$retained->{customer_content} = {
|
||||
status => 'active',
|
||||
contact_id => $retained->{customer_contact_id},
|
||||
billing_profile_id => $retained->{billing_profile_id},
|
||||
type => 'sipaccount',
|
||||
max_subscribers => undef,
|
||||
external_id => undef
|
||||
};
|
||||
}
|
||||
|
||||
#create Subscriber
|
||||
-
|
||||
name: include create Subscriber
|
||||
type: include
|
||||
file: CreateSubscriber.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_map}->{$retained->{customer}->{id}} = $retained->{customer};
|
||||
|
||||
my $cc = 800;
|
||||
my $ac = '1'.(scalar keys %{$retained->{subscriber_map}});
|
||||
my $sn = $retained->{unique_id};
|
||||
$retained->{subscriber_content} = {
|
||||
primary_number => { cc => $cc, ac => $ac, sn => $sn },
|
||||
domain_id => $retained->{domain_id},
|
||||
username => 'subscriber_' . (scalar keys %{$retained->{subscriber_map}}) . '_'.$retained->{unique_id},
|
||||
password => 'subscriber_password',
|
||||
customer_id => $retained->{customer}->{id},
|
||||
};
|
||||
}
|
||||
|
||||
#set Call Forwards
|
||||
-
|
||||
name: include set Call Forwards
|
||||
type: include
|
||||
file: SetCallForwards.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
$retained->{callforwards_content} = {
|
||||
cfu => {
|
||||
destinations => [
|
||||
{ destination => "5678" },
|
||||
{ destination => "autoattendant", },
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#set Call Forwards
|
||||
-
|
||||
name: include set Call Forwards
|
||||
type: include
|
||||
file: SetCallForwards.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
$retained->{callforwards_content} = {
|
||||
cfu => {
|
||||
destinations => [
|
||||
{ destination => "5678" }
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#Check Event History
|
||||
-
|
||||
name: include Chech Event History
|
||||
type: include
|
||||
file: CheckEventHistory.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
$retained->{eventhistory_path} = "api/events/?page=1&rows=10&order_by_direction=asc&order_by=id&subscriber_id=$retained->{subscriber_id}&type=%ivr";
|
||||
|
||||
$retained->{expected_events} = [
|
||||
{ subscriber_id => $retained->{subscriber}->{id}, type => "start_ivr" },
|
||||
{ subscriber_id => $retained->{subscriber}->{id}, type => "end_ivr" },
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,202 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for headerrulesets
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/headerrulesets/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-headerrulesets
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create headerrulesets
|
||||
-
|
||||
name: create headerrulesets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/headerrulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_1_${unique_id}'
|
||||
description: 'api_test rule set description'
|
||||
retain:
|
||||
headerrulesets_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create headerrulesets
|
||||
-
|
||||
name: create headerrulesets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/headerrulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_2_${unique_id}'
|
||||
description: 'api_test rule set description'
|
||||
retain:
|
||||
headerrulesets_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create headerrulesets
|
||||
-
|
||||
name: create headerrulesets
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/headerrulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test_3_${unique_id}'
|
||||
description: 'api_test rule set description'
|
||||
retain:
|
||||
headerrulesets_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/headerrulesets/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for headerrulesets item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${headerrulesets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get headerrulesets
|
||||
-
|
||||
name: GET headerrulesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${headerrulesets_path3}'
|
||||
retain:
|
||||
headerrulesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{headerrulesets}->{_links};
|
||||
delete $retained->{headerrulesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put headerrulesets
|
||||
-
|
||||
name: PUT headerrulesets
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${headerrulesets_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${headerrulesets}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get headerrulesets
|
||||
-
|
||||
name: GET headerrulesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${headerrulesets_path3}'
|
||||
retain:
|
||||
new_headerrulesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_headerrulesets}->{_links};
|
||||
delete $retained->{new_headerrulesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${headerrulesets}': ${new_headerrulesets}
|
||||
|
||||
#create headerrulesets without reseller id
|
||||
-
|
||||
name: create headerrulesets without reseller id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/headerrulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: 'api_test_4_${unique_id}'
|
||||
description: 'api_test rule set description'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='reseller_id'
|
||||
|
||||
#DELETE headerrulesets
|
||||
-
|
||||
name: DELETE headerrulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${headerrulesets_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE headerrulesets
|
||||
-
|
||||
name: DELETE headerrulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${headerrulesets_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE headerrulesets
|
||||
-
|
||||
name: DELETE headerrulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${headerrulesets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,105 @@
|
||||
---
|
||||
#create a BillingProfile
|
||||
-
|
||||
name: create a BillingProfile
|
||||
type: item
|
||||
thread: 1
|
||||
method: POST
|
||||
path: /api/billingprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test profile ${unique_id}
|
||||
handle: test_profile_handle${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
|
||||
#create a Customer Contact
|
||||
-
|
||||
name: create a Customer Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/customercontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: cust_contact_first
|
||||
lastname: cust_contact_last
|
||||
email: cust_contact@custcontact.invalid
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
customer_contact_path: header.location
|
||||
customer_contact_id: header.location
|
||||
|
||||
#check CustomerContact
|
||||
-
|
||||
name: check CustomerContact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_contact_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create customer_path
|
||||
-
|
||||
name: create customer_path
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${customer_contact_id}
|
||||
type: sipaccount
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
max_subscribers: null
|
||||
external_id: null
|
||||
retain:
|
||||
customer_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get customer
|
||||
-
|
||||
name: GET customer
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_path}'
|
||||
retain:
|
||||
customer: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#PATCH customer with DELETE
|
||||
-
|
||||
name: PATCH customer with DELETE
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${customer_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
x-tunneled-method: PATCH
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /status
|
||||
value: terminated
|
||||
retain:
|
||||
new_customer: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${new_customer}.status': terminated
|
||||
@ -0,0 +1,193 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for ncoslevels
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/ncoslevels/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-ncoslevels
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create ncoslevels
|
||||
-
|
||||
name: create ncoslevels
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/ncoslevels/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
level: 'api_test 1 ncos ${unique_id}'
|
||||
mode: 'whitelist'
|
||||
description: 'api_test ncos level description'
|
||||
local_ac: 1
|
||||
intra_pbx: 1
|
||||
retain:
|
||||
ncoslevels_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create ncoslevels
|
||||
-
|
||||
name: create ncoslevels
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/ncoslevels/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
level: 'api_test 2 ncos ${unique_id}'
|
||||
mode: 'whitelist'
|
||||
description: 'api_test ncos level description'
|
||||
local_ac: 1
|
||||
intra_pbx: 1
|
||||
retain:
|
||||
ncoslevels_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create ncoslevels
|
||||
-
|
||||
name: create ncoslevels
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/ncoslevels/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
level: 'api_test 3 ncos ${unique_id}'
|
||||
mode: 'whitelist'
|
||||
description: 'api_test ncos level description'
|
||||
local_ac: 1
|
||||
intra_pbx: 1
|
||||
retain:
|
||||
ncoslevels_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/ncoslevels/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for ncoslevels item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${ncoslevels_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get ncoslevels
|
||||
-
|
||||
name: GET ncoslevels
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${ncoslevels_path3}'
|
||||
retain:
|
||||
ncoslevels: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{ncoslevels}->{_links};
|
||||
delete $retained->{ncoslevels}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put ncoslevels
|
||||
-
|
||||
name: PUT ncoslevels
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${ncoslevels_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${ncoslevels}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get ncoslevels
|
||||
-
|
||||
name: GET ncoslevels
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${ncoslevels_path3}'
|
||||
retain:
|
||||
new_ncoslevels: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_ncoslevels}->{_links};
|
||||
delete $retained->{new_ncoslevels}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${ncoslevels}': ${new_ncoslevels}
|
||||
|
||||
#DELETE ncoslevels
|
||||
-
|
||||
name: DELETE ncoslevels
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${ncoslevels_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE ncoslevels
|
||||
-
|
||||
name: DELETE ncoslevels
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${ncoslevels_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE ncoslevels
|
||||
-
|
||||
name: DELETE ncoslevels
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${ncoslevels_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,204 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for peeringgroups
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/peeringgroups/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-peeringgroups
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create peeringgroups
|
||||
-
|
||||
name: create peeringgroups
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_1
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringgroups
|
||||
-
|
||||
name: create peeringgroups
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_2
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringgroups
|
||||
-
|
||||
name: create peeringgroups
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_3
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create same peeringgroup again
|
||||
-
|
||||
name: create same peering group again
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_1
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/peeringgroups/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for peeringgroups item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${peeringgroups_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get peeringgroups
|
||||
-
|
||||
name: GET peeringgroups
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringgroups_path3}'
|
||||
retain:
|
||||
peeringgroups: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peeringgroups}->{_links};
|
||||
delete $retained->{peeringgroups}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put peeringgroups
|
||||
-
|
||||
name: PUT peeringgroups
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringgroups_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringgroups}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get peeringgroups
|
||||
-
|
||||
name: GET peeringgroups
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringgroups_path3}'
|
||||
retain:
|
||||
new_peeringgroups: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_peeringgroups}->{_links};
|
||||
delete $retained->{new_peeringgroups}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peeringgroups}': ${new_peeringgroups}
|
||||
|
||||
#DELETE peeringgroups
|
||||
-
|
||||
name: DELETE peeringgroups
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringgroups
|
||||
-
|
||||
name: DELETE peeringgroups
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringgroups
|
||||
-
|
||||
name: DELETE peeringgroups
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,590 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for peeringinboundrules
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/peeringinboundrules/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-peeringinboundrules
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create peeringgroup
|
||||
-
|
||||
name: create peeringgroup
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_inbound_rules
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path: header.location
|
||||
peeringgroups_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringinboundrules
|
||||
-
|
||||
name: create peeringinboundrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^111$'
|
||||
reject_code: null
|
||||
reject_reason: null
|
||||
priority: 50
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringinboundrules_path_1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringinboundrules
|
||||
-
|
||||
name: create peeringinboundrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^222$'
|
||||
reject_code: null
|
||||
reject_reason: null
|
||||
priority: 51
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringinboundrules_path_2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringinboundrules
|
||||
-
|
||||
name: create peeringinboundrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^333$'
|
||||
reject_code: null
|
||||
reject_reason: null
|
||||
priority: 52
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringinboundrules_path_3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/peeringinboundrules/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create same peeringinboundrules again
|
||||
-
|
||||
name: create same peeringinboundrules again
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^1111$'
|
||||
reject_code: null
|
||||
reject_reason: null
|
||||
priority: 51
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with reject code but no reject reason
|
||||
-
|
||||
name: create peeringinboundrules with reject code but no reject reason
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^20$'
|
||||
reject_code: 404
|
||||
reject_reason: null
|
||||
priority: 60
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with reject reason but no reject code
|
||||
-
|
||||
name: create peeringinboundrules with reject reason but no reject code
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^21$'
|
||||
reject_code: null
|
||||
reject_reason: 'some reason'
|
||||
priority: 61
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with too small code
|
||||
-
|
||||
name: create peeringinboundrules with too small code
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^22$'
|
||||
reject_code: 399
|
||||
reject_reason: 'some reason'
|
||||
priority: 62
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with too large code
|
||||
-
|
||||
name: create peeringinboundrules with too large code
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^23$'
|
||||
reject_code: 701
|
||||
reject_reason: 'some reason'
|
||||
priority: 63
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with valid code and reason
|
||||
-
|
||||
name: create peeringinboundrules with valid code and reason
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: '^24$'
|
||||
reject_code: 400
|
||||
reject_reason: 'some reason'
|
||||
priority: 64
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringinboundrules with invalid group_id
|
||||
-
|
||||
name: create peeringinboundrules with invalid group_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: 99999
|
||||
field: 'ruri_uri'
|
||||
pattern: '^25$'
|
||||
reject_code: 400
|
||||
reject_reason: 'some reason'
|
||||
priority: 65
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules with specific priority
|
||||
-
|
||||
name: create peeringinboundrules with specific priority
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: 'my_identical_prio'
|
||||
reject_code: 400
|
||||
reject_reason: 'some reason'
|
||||
priority: 99
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringinboundrules with identical priority
|
||||
-
|
||||
name: create peeringinboundrules with identical priority
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: 'my_identical_prio1'
|
||||
reject_code: 400
|
||||
reject_reason: 'some reason'
|
||||
priority: 99
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create peeringinboundrules for preparing priority move attempt
|
||||
-
|
||||
name: create peeringinboundrules for preparing priority move attempt
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringinboundrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
field: 'ruri_uri'
|
||||
pattern: 'my_move_attempt'
|
||||
reject_code: 400
|
||||
reject_reason: 'some reason'
|
||||
priority: 101
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringinboundrules_path4: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#fetch rule for prioritymove attempt
|
||||
-
|
||||
name: fetch rule for prioritymove attempt
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
retain:
|
||||
peeringinboundrule: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peeringinboundrule}->{_links};
|
||||
delete $retained->{peeringinboundrule}->{_embedded};
|
||||
$retained->{peeringinboundrule}->{priority} = 99;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#PUT with existing priority
|
||||
-
|
||||
name: PUT with existing priority
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{priority} = 102;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PUT with new priority
|
||||
-
|
||||
name: PUT with new priority
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{reject_reason} = 'some reason';
|
||||
$retained->{peeringinboundrule}->{reject_code} = undef;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#PUT with reason but no code
|
||||
-
|
||||
name: PUT with reason but no code
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{reject_reason} = undef;
|
||||
$retained->{peeringinboundrule}->{reject_code} = 401;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PUT with code but no reason
|
||||
-
|
||||
name: PUT with code but no reason
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{reject_reason} = 'some reason';
|
||||
$retained->{peeringinboundrule}->{reject_code} = 301;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PUT with too small code
|
||||
-
|
||||
name: PUT with too small code
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{reject_reason} = 'some reason';
|
||||
$retained->{peeringinboundrule}->{reject_code} = 701;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PUT with too large code
|
||||
-
|
||||
name: PUT with too large code
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{peeringinboundrule}->{reject_reason} = 'some reason';
|
||||
$retained->{peeringinboundrule}->{reject_code} = 404;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PUT with valid code and reason
|
||||
-
|
||||
name: PUT with valid code and reason
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrule}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for peeringinboundrules item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${peeringinboundrules_path_3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get peeringinboundrules
|
||||
-
|
||||
name: GET peeringinboundrules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringinboundrules_path_3}'
|
||||
retain:
|
||||
peeringinboundrules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peeringinboundrules}->{_links};
|
||||
delete $retained->{peeringinboundrules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put peeringinboundrules
|
||||
-
|
||||
name: PUT peeringinboundrules
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringinboundrules_path_3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringinboundrules}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get peeringinboundrules
|
||||
-
|
||||
name: GET peeringinboundrules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringinboundrules_path_3}'
|
||||
retain:
|
||||
new_peeringinboundrules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_peeringinboundrules}->{_links};
|
||||
delete $retained->{new_peeringinboundrules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peeringinboundrules}': ${new_peeringinboundrules}
|
||||
|
||||
#DELETE peeringinboundrules
|
||||
-
|
||||
name: DELETE peeringinboundrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringinboundrules_path_1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringinboundrules
|
||||
-
|
||||
name: DELETE peeringinboundrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringinboundrules_path_2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringinboundrules
|
||||
-
|
||||
name: DELETE peeringinboundrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringinboundrules_path_3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringinboundrules
|
||||
-
|
||||
name: DELETE peeringinboundrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringinboundrules_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringgroup
|
||||
-
|
||||
name: DELETE peeringgroup
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,242 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for peeringrules
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/peeringrules/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-peeringrules
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create peeringgroup
|
||||
-
|
||||
name: create peeringgroup
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_peering_rules
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path: header.location
|
||||
peeringgroups_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringrules
|
||||
-
|
||||
name: create peeringrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
callee_prefix: 111
|
||||
callee_pattern: '^111$'
|
||||
caller_pattern: '^222$'
|
||||
description: 'api_test peering rule'
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringrules_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringrules
|
||||
-
|
||||
name: create peeringrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
callee_prefix: 222
|
||||
callee_pattern: '^111$'
|
||||
caller_pattern: '^222$'
|
||||
description: 'api_test peering rule'
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringrules_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringrules
|
||||
-
|
||||
name: create peeringrules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
callee_prefix: 333
|
||||
callee_pattern: '^111$'
|
||||
caller_pattern: '^222$'
|
||||
description: 'api_test peering rule'
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringrules_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create same peering rule code again
|
||||
-
|
||||
name: create same peering rule code again
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringrules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
callee_prefix: 111
|
||||
callee_pattern: '^111$'
|
||||
caller_pattern: '^222$'
|
||||
description: 'api_test peering rule'
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/peeringrules/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for peeringrules item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${peeringrules_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get peeringrules
|
||||
-
|
||||
name: GET peeringrules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringrules_path3}'
|
||||
retain:
|
||||
peeringrules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peeringrules}->{_links};
|
||||
delete $retained->{peeringrules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put peeringrules
|
||||
-
|
||||
name: PUT peeringrules
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringrules_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringrules}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get peeringrules
|
||||
-
|
||||
name: GET peeringrules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringrules_path3}'
|
||||
retain:
|
||||
new_peeringrules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_peeringrules}->{_links};
|
||||
delete $retained->{new_peeringrules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peeringrules}': ${new_peeringrules}
|
||||
|
||||
#DELETE peeringrules
|
||||
-
|
||||
name: DELETE peeringrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringrules_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringrules
|
||||
-
|
||||
name: DELETE peeringrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringrules_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringrules
|
||||
-
|
||||
name: DELETE peeringrules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringrules_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringgroup
|
||||
-
|
||||
name: DELETE peeringgroup
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,258 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for peeringservers
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/peeringservers/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-peeringservers
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create peeringgroup
|
||||
-
|
||||
name: create peeringgroup
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringgroups/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_api_p_group_peering_servers
|
||||
description: test_api peering group
|
||||
priority: 1
|
||||
contract_id: 1
|
||||
retain:
|
||||
peeringgroups_path: header.location
|
||||
peeringgroups_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringservers
|
||||
-
|
||||
name: create peeringservers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringservers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
name: 'test_api peering host 1'
|
||||
ip: '1.1.1.1'
|
||||
host: 'test-api.com'
|
||||
port: 1025
|
||||
transport: 1
|
||||
weight: 1
|
||||
via_route: ''
|
||||
via_lb: ''
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringservers_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringservers
|
||||
-
|
||||
name: create peeringservers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringservers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
name: 'test_api peering host 2'
|
||||
ip: '1.1.1.1'
|
||||
host: 'test-api.com'
|
||||
port: 1025
|
||||
transport: 1
|
||||
weight: 1
|
||||
via_route: ''
|
||||
via_lb: ''
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringservers_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create peeringservers
|
||||
-
|
||||
name: create peeringservers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringservers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
name: 'test_api peering host 3'
|
||||
ip: '1.1.1.1'
|
||||
host: 'test-api.com'
|
||||
port: 1025
|
||||
transport: 1
|
||||
weight: 1
|
||||
via_route: ''
|
||||
via_lb: ''
|
||||
enabled: 1
|
||||
retain:
|
||||
peeringservers_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create same peering server code again
|
||||
-
|
||||
name: create same peering server code again
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/peeringservers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
group_id: ${peeringgroups_id}
|
||||
name: 'test_api peering host 1'
|
||||
ip: '1.1.1.1'
|
||||
host: 'test-api.com'
|
||||
port: 1025
|
||||
transport: 1
|
||||
weight: 1
|
||||
via_route: ''
|
||||
via_lb: ''
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/peeringservers/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for peeringservers item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${peeringservers_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get peeringservers
|
||||
-
|
||||
name: GET peeringservers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringservers_path3}'
|
||||
retain:
|
||||
peeringservers: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{peeringservers}->{_links};
|
||||
delete $retained->{peeringservers}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put peeringservers
|
||||
-
|
||||
name: PUT peeringservers
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${peeringservers_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${peeringservers}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get peeringservers
|
||||
-
|
||||
name: GET peeringservers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${peeringservers_path3}'
|
||||
retain:
|
||||
new_peeringservers: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_peeringservers}->{_links};
|
||||
delete $retained->{new_peeringservers}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${peeringservers}': ${new_peeringservers}
|
||||
|
||||
#DELETE peeringservers
|
||||
-
|
||||
name: DELETE peeringservers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringservers_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringservers
|
||||
-
|
||||
name: DELETE peeringservers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringservers_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringservers
|
||||
-
|
||||
name: DELETE peeringservers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringservers_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE peeringgroup
|
||||
-
|
||||
name: DELETE peeringgroup
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${peeringgroups_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,179 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for preferencesmetaentries
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/preferencesmetaentries/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-preferencesmetaentries
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create preferencesmetaentries
|
||||
-
|
||||
name: create preferencesmetaentries
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/preferencesmetaentries/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
label: Custom pbx device model preference 1 ${unique_id}
|
||||
description: Custom pbx device model preference description 1 ${unique_id}
|
||||
attribute: api_test_1_${unique_id}
|
||||
fielddev_pref: 1
|
||||
max_occur: 1
|
||||
data_type: enum
|
||||
autoprov_device_id: 1
|
||||
dev_pref: 1
|
||||
enum:
|
||||
-
|
||||
label: api_test_enum_1
|
||||
value: 1
|
||||
default_val: 0
|
||||
-
|
||||
label: api_test_enum2
|
||||
value: 2
|
||||
default_val: 1
|
||||
retain:
|
||||
preferencesmetaentries_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create preferencesmetaentries
|
||||
-
|
||||
name: create preferencesmetaentries
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/preferencesmetaentries/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
label: Custom pbx device model preference 2 ${unique_id}
|
||||
description: Custom pbx device model preference description 2 ${unique_id}
|
||||
attribute: api_test_2_${unique_id}
|
||||
fielddev_pref: 1
|
||||
max_occur: 1
|
||||
data_type: enum
|
||||
autoprov_device_id: 1
|
||||
dev_pref: 1
|
||||
enum:
|
||||
-
|
||||
label: api_test_enum_1
|
||||
value: 1
|
||||
default_val: 0
|
||||
-
|
||||
label: api_test_enum2
|
||||
value: 2
|
||||
default_val: 1
|
||||
retain:
|
||||
preferencesmetaentries_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create preferencesmetaentries
|
||||
-
|
||||
name: create preferencesmetaentries
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/preferencesmetaentries/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
label: Custom pbx device model preference 3 ${unique_id}
|
||||
description: Custom pbx device model preference description 3 ${unique_id}
|
||||
attribute: api_test_3_${unique_id}
|
||||
fielddev_pref: 1
|
||||
max_occur: 1
|
||||
data_type: enum
|
||||
autoprov_device_id: 1
|
||||
dev_pref: 1
|
||||
enum:
|
||||
-
|
||||
label: api_test_enum_1
|
||||
value: 1
|
||||
default_val: 0
|
||||
-
|
||||
label: api_test_enum2
|
||||
value: 2
|
||||
default_val: 1
|
||||
retain:
|
||||
preferencesmetaentries_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
skip: 1
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/preferencesmetaentries/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get preferencesmetaentries
|
||||
-
|
||||
name: GET preferencesmetaentries
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${preferencesmetaentries_path}'
|
||||
retain:
|
||||
preferencesmetaentries: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{preferencesmetaentries}->{_links};
|
||||
delete $retained->{preferencesmetaentries}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put preferencesmetaentries
|
||||
-
|
||||
name: PUT preferencesmetaentries
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${preferencesmetaentries_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${preferencesmetaentries}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get preferencesmetaentries
|
||||
-
|
||||
name: GET preferencesmetaentries
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${preferencesmetaentries_path}'
|
||||
retain:
|
||||
new_preferencesmetaentries: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_preferencesmetaentries}->{_links};
|
||||
delete $retained->{new_preferencesmetaentries}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${preferencesmetaentries}': ${new_preferencesmetaentries}
|
||||
@ -0,0 +1,693 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for profilepackages
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/profilepackages/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-profilepackages
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_profile_${unique_id}
|
||||
name: test profile ${unique_id}
|
||||
retain:
|
||||
billingprofile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get billingprofile
|
||||
-
|
||||
name: get billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/billingprofiles/${billingprofile_id}'
|
||||
retain:
|
||||
billingprofile: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create prepaid billingprofile
|
||||
-
|
||||
name: create prepaid billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_prepaid_${unique_id}
|
||||
name: test prepaid ${unique_id}
|
||||
prepaid: 1
|
||||
retain:
|
||||
prepaid_billingprofile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get prepaid billingprofile
|
||||
-
|
||||
name: get prepaid billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/billingprofiles/${prepaid_billingprofile_id}'
|
||||
retain:
|
||||
prepaid_billingprofile: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create free cash billingprofile
|
||||
-
|
||||
name: create free cash billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_free_cash_${unique_id}
|
||||
name: test free cash ${unique_id}
|
||||
interval_free_cash: 100
|
||||
retain:
|
||||
free_cash_billingprofile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get free cash billingprofile
|
||||
-
|
||||
name: get free cash billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/billingprofiles/${free_cash_billingprofile_id}'
|
||||
retain:
|
||||
free_cash_billingprofile: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create free time billingprofile
|
||||
-
|
||||
name: create free time billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_free_time_${unique_id}
|
||||
name: test free time ${unique_id}
|
||||
interval_free_time: 100
|
||||
retain:
|
||||
free_time_billingprofile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get billingprofile
|
||||
-
|
||||
name: get billingprofile
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/billingprofiles/${free_time_billingprofile_id}'
|
||||
retain:
|
||||
free_time_billingprofile: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#POST billingnetwork
|
||||
-
|
||||
name: POST billingnetwork
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/billingnetworks/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test billing network ${unique_id}
|
||||
description: test billing network description ${unique_id}
|
||||
reseller_id: 1
|
||||
blocks:
|
||||
-
|
||||
ip: 'fdfe::5a55:caff:fefa:9089'
|
||||
mask: 128
|
||||
-
|
||||
ip: 'fdfe::5a55:caff:fefa:908a'
|
||||
-
|
||||
ip: 'fdfe::5a55:caff:fefa:908b'
|
||||
mask: 128
|
||||
retain:
|
||||
billingnetwork_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#GET billingnetwork
|
||||
-
|
||||
name: fetch POSTed billingnetwork
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/billingnetworks/${billingnetwork_id}'
|
||||
retain:
|
||||
billingnetwork: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{initial_profiles} = [{ profile_id => $retained->{billingprofile_id}, }, ];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create profilepackage
|
||||
-
|
||||
name: create profilepackage
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: test profile package ${unique_id}
|
||||
description: test profile package description ${unique_id}
|
||||
initial_profiles: ${initial_profiles}
|
||||
retain:
|
||||
profilepackage_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get profilepackage
|
||||
-
|
||||
name: get profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path}'
|
||||
retain:
|
||||
profilepackage: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put profilepackage
|
||||
-
|
||||
name: PUT profilepackage
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${profilepackage_path}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test profile package PUT ${unique_id}
|
||||
description: test profile package description PUT ${unique_id}
|
||||
initial_profiles: ${initial_profiles}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get PUT profilepackage
|
||||
-
|
||||
name: get PUT profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path}'
|
||||
retain:
|
||||
profilepackage: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#patch profilepackage
|
||||
-
|
||||
name: patch profilepackage
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${profilepackage_path}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /name
|
||||
value: test profile package PATCH
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get PATCHed profilepackage
|
||||
-
|
||||
name: get PATCHed profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path}'
|
||||
retain:
|
||||
profilepackage: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE profilepackage
|
||||
-
|
||||
name: DELETE profilepackage
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${profilepackage_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get deleted profilepackage
|
||||
-
|
||||
name: get deleted profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path}'
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content} = {
|
||||
name => "test profile package 1". ' ' . $retained->{unique_id},
|
||||
description => "test profile package description 1 " . $retained->{unique_id},
|
||||
reseller_id => 1,
|
||||
#status => 'active',
|
||||
initial_profiles => [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}],
|
||||
initial_balance => 0.0,
|
||||
balance_interval_value => 30,
|
||||
balance_interval_unit => 'day',
|
||||
balance_interval_start_mode => 'create',
|
||||
service_charge => 0.0,
|
||||
notopup_discard_intervals => undef,
|
||||
carry_over_mode => 'carry_over',
|
||||
timely_duration_value => 7,
|
||||
timely_duration_unit => 'day',
|
||||
underrun_profile_threshold => 0.0,
|
||||
underrun_profiles => [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ],
|
||||
underrun_lock_threshold => 0.0,
|
||||
underrun_lock_level => 4,
|
||||
topup_profiles => [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ],
|
||||
topup_lock_level => undef,
|
||||
}
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
|
||||
#create profilepackage
|
||||
-
|
||||
name: create profilepackage
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
retain:
|
||||
profilepackage_path1: header.location
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{name} = "test profile package 2". ' ' . $retained->{unique_id};
|
||||
$retained->{profilepackage_content}->{description} = "test profile package description 1 " . $retained->{unique_id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get profilepackage
|
||||
-
|
||||
name: get profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path1}'
|
||||
retain:
|
||||
profilepackage1: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create profilepackage
|
||||
-
|
||||
name: create profilepackage
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
retain:
|
||||
profilepackage_path2: header.location
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{name} = "test profile package 3". ' ' . $retained->{unique_id};
|
||||
$retained->{profilepackage_content}->{description} = "test profile package description 3 " . $retained->{unique_id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get profilepackage
|
||||
-
|
||||
name: get profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path2}'
|
||||
retain:
|
||||
profilepackage2: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create profilepackage
|
||||
-
|
||||
name: create profilepackage
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
retain:
|
||||
profilepackage_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get profilepackage
|
||||
-
|
||||
name: get profilepackage
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${profilepackage_path3}'
|
||||
retain:
|
||||
profilepackage3: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{link} = "/api/profilepackages/?page=1&rows=5&network_name=".$retained->{billingnetwork}->{name};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get profilepackages
|
||||
-
|
||||
name: get profilepackages
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${link}'
|
||||
retain:
|
||||
collection: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{got_profilepackages} = $retained->{collection}->{_embedded}->{'ngcp:profilepackages'};
|
||||
$retained->{posted_profilepackages} = [$retained->{profilepackage1}, $retained->{profilepackage2}, $retained->{profilepackage3}];
|
||||
|
||||
$retained->{profilepackage_content}->{name} = "test profile package 4". ' ' . $retained->{unique_id};
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{prepaid_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${got_profilepackages}': '${posted_profilepackages}'
|
||||
|
||||
#check if mixing prepaid initial profiles is prohibited
|
||||
-
|
||||
name: check if mixing prepaid initial profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [{ profile_id => $retained->{prepaid_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'Mixing prepaid'
|
||||
|
||||
#check if mixing prepaid underrun profiles is prohibited
|
||||
-
|
||||
name: check if mixing prepaid underrun profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{prepaid_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'Mixing prepaid'
|
||||
|
||||
#check if mixing prepaid topup profiles is prohibited
|
||||
-
|
||||
name: check if mixing prepaid topup profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{prepaid_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{prepaid_billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'Mixing prepaid'
|
||||
|
||||
#check if creating a package with mixed prepaid profile sets was ok
|
||||
-
|
||||
name: check if creating a package with mixed prepaid profile sets was ok
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{free_cash_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#check if mixing free cash initial profiles is prohibited
|
||||
-
|
||||
name: check if mixing free cash initial profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [{ profile_id => $retained->{free_cash_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_cash'
|
||||
|
||||
#check if mixing free cash underrun profiles is prohibited
|
||||
-
|
||||
name: check if mixing free cash underrun profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{free_cash_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_cash'
|
||||
|
||||
#check if mixing free cash topup profiles is prohibited
|
||||
-
|
||||
name: check if mixing free cash topup profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{name} = "test profile package 5". ' ' . $retained->{unique_id};
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{free_cash_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{free_cash_billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_cash'
|
||||
|
||||
#check if creating a package with mixed free cash profile sets was ok
|
||||
-
|
||||
name: check if creating a package with mixed free cash profile sets was ok
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{free_time_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#check if mixing free time initial profiles is prohibited
|
||||
-
|
||||
name: check if mixing free time initial profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [{ profile_id => $retained->{free_time_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_time'
|
||||
|
||||
#check if mixing free time underrun profiles is prohibited
|
||||
-
|
||||
name: check if mixing free time underrun profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{free_time_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_time'
|
||||
|
||||
#check if mixing free time topup profiles is prohibited
|
||||
-
|
||||
name: check if mixing free time topup profiles is prohibited
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{profilepackage_content}->{name} = "test profile package 6". ' ' . $retained->{unique_id};
|
||||
$retained->{profilepackage_content}->{initial_profiles} = [{ profile_id => $retained->{free_time_billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{free_time_billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
$retained->{profilepackage_content}->{underrun_profiles} = [ { profile_id => $retained->{billingprofile_id}, network_id => undef } ];
|
||||
$retained->{profilepackage_content}->{topup_profiles} = [{ profile_id => $retained->{billingprofile_id}, network_id => undef },
|
||||
{ profile_id => $retained->{billingprofile_id}, network_id => $retained->{billingnetwork_id}}];
|
||||
}
|
||||
conditions:
|
||||
like:
|
||||
body.message: 'the same interval_free_time'
|
||||
|
||||
#check if creating a package with mixed free time profile sets was ok
|
||||
-
|
||||
name: check if creating a package with mixed free time profile sets was ok
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/profilepackages/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: ${profilepackage_content}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
@ -0,0 +1,597 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for resellers
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/resellers/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-resellers
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create a System Contact
|
||||
-
|
||||
name: create a System Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first
|
||||
lastname: sys_contact_last
|
||||
email: sys_contact@syscontact.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
system_contact_path: header.location
|
||||
system_contact_id: header.location
|
||||
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_profile_${unique_id}
|
||||
name: test profile ${unique_id}
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create contract
|
||||
-
|
||||
name: create contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/contracts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${system_contact_id}
|
||||
type: reseller
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
retain:
|
||||
contract1_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create contract
|
||||
-
|
||||
name: create contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/contracts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${system_contact_id}
|
||||
type: reseller
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
retain:
|
||||
contract2_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create contract
|
||||
-
|
||||
name: create contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/contracts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${system_contact_id}
|
||||
type: reseller
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
retain:
|
||||
contract3_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create contract
|
||||
-
|
||||
name: create contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/contracts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${system_contact_id}
|
||||
type: reseller
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
retain:
|
||||
contract4_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create reseller
|
||||
-
|
||||
name: create reseller
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract1_id}
|
||||
status: active
|
||||
name: test reseller 1 ${unique_id}
|
||||
retain:
|
||||
reseller_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create reseller
|
||||
-
|
||||
name: create reseller
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract2_id}
|
||||
status: active
|
||||
name: test reseller 2 ${unique_id}
|
||||
retain:
|
||||
reseller_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create reseller
|
||||
-
|
||||
name: create reseller
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract3_id}
|
||||
status: active
|
||||
name: test reseller 3 ${unique_id}
|
||||
retain:
|
||||
reseller_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create reseller without contract id
|
||||
-
|
||||
name: create reseller without contract id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
name: test reseller 4 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='contract_id'
|
||||
|
||||
#create reseller with empty contract id
|
||||
-
|
||||
name: create reseller with empty contract id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: null
|
||||
status: active
|
||||
name: test reseller 4 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='contract_id'
|
||||
|
||||
#create reseller with existing contract id
|
||||
-
|
||||
name: create reseller with existing contract id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract1_id}
|
||||
status: active
|
||||
name: test reseller 4 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: reseller with this contract already exists
|
||||
|
||||
#create reseller with existing name
|
||||
-
|
||||
name: create reseller with existing name
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract4_id}
|
||||
status: active
|
||||
name: test reseller 1 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: reseller with this name already exists
|
||||
|
||||
#create reseller with missing name
|
||||
-
|
||||
name: create reseller with missing name
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract4_id}
|
||||
status: active
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='name'
|
||||
|
||||
#create reseller with missing status
|
||||
-
|
||||
name: create reseller with missing status
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract4_id}
|
||||
name: test reseller 4 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='status'
|
||||
|
||||
#create reseller with invalid status
|
||||
-
|
||||
name: create reseller with invalid status
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/resellers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contract_id: ${contract4_id}
|
||||
name: test reseller 4 ${unique_id}
|
||||
status: invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='status'
|
||||
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/resellers/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for resellers item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${reseller_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
|
||||
#get reseller
|
||||
-
|
||||
name: GET reseller
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${reseller_path3}'
|
||||
retain:
|
||||
reseller: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{reseller}->{_links};
|
||||
delete $retained->{reseller}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${reseller}.id': defined
|
||||
'${reseller}.contract_id': defined
|
||||
'${reseller}.name': defined
|
||||
'${reseller}.status': defined
|
||||
like:
|
||||
'${reseller}.id': '[0-9]+'
|
||||
'${reseller}.contract_id': '[0-9]+'
|
||||
|
||||
#put reseller with missing content type
|
||||
-
|
||||
name: PUT reseller with missing content type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put reseller with unsuported content type
|
||||
-
|
||||
name: PUT reseller with unsuported content type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/xxx
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put reseller with no body
|
||||
-
|
||||
name: PUT reseller with no body
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
|
||||
#put reseller
|
||||
-
|
||||
name: PUT reseller
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${reseller}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get reseller
|
||||
-
|
||||
name: GET reseller
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${reseller_path3}'
|
||||
retain:
|
||||
new_reseller: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_reseller}->{_links};
|
||||
delete $retained->{new_reseller}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${reseller}': ${new_reseller}
|
||||
|
||||
#PATCH reseller
|
||||
-
|
||||
name: PATCH reseller
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /name
|
||||
value: patched reseller name ${unique_id}
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{patched_name} = 'patched reseller name '.$retained->{unique_id};
|
||||
}
|
||||
retain:
|
||||
patched_reseller: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${patched_reseller}.name': '${patched_name}'
|
||||
'${patched_reseller}._links.self.href': '${reseller_path3}'
|
||||
'${patched_reseller}._links.collection.href': '/api/resellers/'
|
||||
|
||||
#PATCH reseller with undef contract id
|
||||
-
|
||||
name: PATCH reseller with undef contract id
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /contract_id
|
||||
value: null
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with invalid contract id
|
||||
-
|
||||
name: PATCH reseller with invalid contract id
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /contract_id
|
||||
value: 99999
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with existing contract id
|
||||
-
|
||||
name: PATCH reseller with existing contract id
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /contract_id
|
||||
value: ${contract2_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with existing name
|
||||
-
|
||||
name: PATCH reseller with existing name
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /name
|
||||
value: test reseller 2 ${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with undef name
|
||||
-
|
||||
name: PATCH reseller with undef name
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /name
|
||||
value: null
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with invalid status
|
||||
-
|
||||
name: PATCH reseller with invalid status
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /status
|
||||
value: invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#PATCH reseller with undef status
|
||||
-
|
||||
name: PATCH reseller with undef status
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${reseller_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /status
|
||||
value: null
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
@ -0,0 +1,321 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for rewriterulesets
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/rewriterulesets/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-rewriterulesets
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create rewriteruleset
|
||||
-
|
||||
name: create rewriteruleset
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test1'
|
||||
description: 'api_test rule set description'
|
||||
caller_in_dpid: 1
|
||||
callee_in_dpid: 2
|
||||
caller_out_dpid: 3
|
||||
callee_out_dpid: 4
|
||||
rewriterules:
|
||||
-
|
||||
match_pattern: '^111$'
|
||||
replace_pattern: '222'
|
||||
description: 'test_api rewrite rule 1'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^333$'
|
||||
replace_pattern: '444'
|
||||
description: 'test_api rewrite rule 2'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 2
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^555$'
|
||||
replace_pattern: '666'
|
||||
description: 'test_api rewrite rule 3'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 3
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterulesets_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create rewriteruleset
|
||||
-
|
||||
name: create rewriteruleset
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test2'
|
||||
description: 'api_test rule set description'
|
||||
caller_in_dpid: 1
|
||||
callee_in_dpid: 2
|
||||
caller_out_dpid: 3
|
||||
callee_out_dpid: 4
|
||||
rewriterules:
|
||||
-
|
||||
match_pattern: '^111$'
|
||||
replace_pattern: '222'
|
||||
description: 'test_api rewrite rule 1'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^333$'
|
||||
replace_pattern: '444'
|
||||
description: 'test_api rewrite rule 2'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 2
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^555$'
|
||||
replace_pattern: '666'
|
||||
description: 'test_api rewrite rule 3'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 3
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterulesets_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create rewriteruleset
|
||||
-
|
||||
name: create rewriteruleset
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test3'
|
||||
description: 'api_test rule set description'
|
||||
caller_in_dpid: 1
|
||||
callee_in_dpid: 2
|
||||
caller_out_dpid: 3
|
||||
callee_out_dpid: 4
|
||||
rewriterules:
|
||||
-
|
||||
match_pattern: '^111$'
|
||||
replace_pattern: '222'
|
||||
description: 'test_api rewrite rule 1'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^333$'
|
||||
replace_pattern: '444'
|
||||
description: 'test_api rewrite rule 2'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 2
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^555$'
|
||||
replace_pattern: '666'
|
||||
description: 'test_api rewrite rule 3'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 3
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterulesets_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/rewriterulesets/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for rewriterulesets item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${rewriterulesets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get rewriterulesets
|
||||
-
|
||||
name: GET rewriterulesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${rewriterulesets_path3}'
|
||||
retain:
|
||||
rewriterulesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{rewriterulesets}->{_links};
|
||||
delete $retained->{rewriterulesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put rewriterulesets
|
||||
-
|
||||
name: PUT rewriterulesets
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${rewriterulesets_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${rewriterulesets}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get rewriterulesets
|
||||
-
|
||||
name: GET rewriterulesets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${rewriterulesets_path3}'
|
||||
retain:
|
||||
new_rewriterulesets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_rewriterulesets}->{_links};
|
||||
delete $retained->{new_rewriterulesets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${rewriterulesets}': ${new_rewriterulesets}
|
||||
|
||||
#create rewriteruleset without reseller_id
|
||||
-
|
||||
name: create rewriteruleset without reseller_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: null
|
||||
name: 'api_test4'
|
||||
description: 'api_test rule set description'
|
||||
caller_in_dpid: 1
|
||||
callee_in_dpid: 2
|
||||
caller_out_dpid: 3
|
||||
callee_out_dpid: 4
|
||||
rewriterules:
|
||||
-
|
||||
match_pattern: '^111$'
|
||||
replace_pattern: '222'
|
||||
description: 'test_api rewrite rule 1'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^333$'
|
||||
replace_pattern: '444'
|
||||
description: 'test_api rewrite rule 2'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 2
|
||||
enabled: 1
|
||||
-
|
||||
match_pattern: '^555$'
|
||||
replace_pattern: '666'
|
||||
description: 'test_api rewrite rule 3'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 3
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterulesets_path4: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='reseller_id'
|
||||
|
||||
#DELETE rewriterulesets
|
||||
-
|
||||
name: DELETE rewriterulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterulesets_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE rewriterulesets
|
||||
-
|
||||
name: DELETE rewriterulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterulesets_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE rewriterulesets
|
||||
-
|
||||
name: DELETE rewriterulesets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterulesets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,367 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for rewriterules
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/rewriterules/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-rewriterules
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create rewriteruleset
|
||||
-
|
||||
name: create rewriteruleset
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterulesets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test'
|
||||
description: 'api_test rule set description'
|
||||
caller_in_dpid: 1
|
||||
callee_in_dpid: 2
|
||||
caller_out_dpid: 3
|
||||
callee_out_dpid: 4
|
||||
rewriterules: null
|
||||
retain:
|
||||
rewriterulesets_path: header.location
|
||||
rewriterulesets_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create rewriterules
|
||||
-
|
||||
name: create rewriterules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: ${rewriterulesets_id}
|
||||
match_pattern: '^111$'
|
||||
replace_pattern: '222'
|
||||
description: 'test_api rewrite rule 1'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterules_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create rewriterules
|
||||
-
|
||||
name: create rewriterules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: ${rewriterulesets_id}
|
||||
match_pattern: '^333$'
|
||||
replace_pattern: '444'
|
||||
description: 'test_api rewrite rule 2'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterules_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create rewriterules
|
||||
-
|
||||
name: create rewriterules
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: ${rewriterulesets_id}
|
||||
match_pattern: '^555$'
|
||||
replace_pattern: '666'
|
||||
description: 'test_api rewrite rule 3'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
retain:
|
||||
rewriterules_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/rewriterules/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for rewriterules item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${rewriterules_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get rewriterules
|
||||
-
|
||||
name: GET rewriterules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${rewriterules_path3}'
|
||||
retain:
|
||||
rewriterules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{rewriterules}->{_links};
|
||||
delete $retained->{rewriterules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put rewriterules
|
||||
-
|
||||
name: PUT rewriterules
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${rewriterules_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${rewriterules}'
|
||||
retain:
|
||||
new_rewriterules: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${new_rewriterules}._links.ngcp:rewriterules': defined
|
||||
'${new_rewriterules}._links.ngcp:rewriterulesets': defined
|
||||
'${new_rewriterules}.direction': defined
|
||||
'${new_rewriterules}.field': defined
|
||||
'${new_rewriterules}.match_pattern': defined
|
||||
'${new_rewriterules}.replace_pattern': defined
|
||||
'${new_rewriterules}.description': defined
|
||||
like:
|
||||
'${new_rewriterules}.direction': '^(in|out)$'
|
||||
'${new_rewriterules}.field': '^(caller|callee)$'
|
||||
|
||||
#get rewriterules
|
||||
-
|
||||
name: GET rewriterules
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${rewriterules_path3}'
|
||||
retain:
|
||||
new_rewriterules: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_rewriterules}->{_links};
|
||||
delete $retained->{new_rewriterules}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${rewriterules}': ${new_rewriterules}
|
||||
|
||||
#create rewriterules with invalid set_id
|
||||
-
|
||||
name: create rewriterules with invalid set_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: 99999
|
||||
match_pattern: '^777$'
|
||||
replace_pattern: '888'
|
||||
description: 'test_api rewrite rule 4'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: Invalid 'set_id'
|
||||
|
||||
#create rewriterules with negative set_id
|
||||
-
|
||||
name: create rewriterules with negative set_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: -100
|
||||
match_pattern: '^777$'
|
||||
replace_pattern: '888'
|
||||
description: 'test_api rewrite rule 4'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: (Invalid|Validation failed).*'set_id'
|
||||
|
||||
#create rewriterules without set_id
|
||||
-
|
||||
name: create rewriterules without set_id
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: null
|
||||
match_pattern: '^777$'
|
||||
replace_pattern: '888'
|
||||
description: 'test_api rewrite rule 4'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: "Required: 'set_id'|set_id.*required"
|
||||
|
||||
#create rewriterules without match_pattern
|
||||
-
|
||||
name: create rewriterules without match_pattern
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: ${rewriterulesets_id}
|
||||
match_pattern: null
|
||||
replace_pattern: '888'
|
||||
description: 'test_api rewrite rule 4'
|
||||
direction: 'in'
|
||||
field: 'caller'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='match_pattern'
|
||||
|
||||
#create rewriterules with invalid direction and field
|
||||
-
|
||||
name: create rewriterules with invalid direction and field
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/rewriterules/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
set_id: ${rewriterulesets_id}
|
||||
match_pattern: '^777$'
|
||||
replace_pattern: '888'
|
||||
description: 'test_api rewrite rule 4'
|
||||
direction: 'foo'
|
||||
field: 'bar'
|
||||
priority: 1
|
||||
enabled: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='direction'
|
||||
body.message: field='field'
|
||||
|
||||
#DELETE rewriterules
|
||||
-
|
||||
name: DELETE rewriterules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterules_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE rewriterules
|
||||
-
|
||||
name: DELETE rewriterules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterules_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE rewriterules
|
||||
-
|
||||
name: DELETE rewriterules
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterules_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE rewriteruleset
|
||||
-
|
||||
name: DELETE rewriteruleset
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${rewriterulesets_path}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,245 @@
|
||||
---
|
||||
#get a customer for testing
|
||||
-
|
||||
name: get a customer for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/customers/?page=1&rows=1&reseller_id=1'
|
||||
retain:
|
||||
customer: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $customer = $retained->{customer}->{'_embedded'}->{'ngcp:customers'}->[0];
|
||||
$retained->{customer} = $customer;
|
||||
$retained->{customer_id} = $customer->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${customer}.id': defined
|
||||
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for soundsets
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/soundsets/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-soundsets
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create soundset with files
|
||||
-
|
||||
name: create soundset with files
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/soundsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
contract_id: ${customer_id}
|
||||
name: 'api_test soundset name 1'
|
||||
description: 'api_test soundset description'
|
||||
contract_default: 1
|
||||
copy_from_default: 1
|
||||
language: 'en'
|
||||
override: 1
|
||||
loopplay: 1
|
||||
retain:
|
||||
soundsets_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create soundset without contract
|
||||
-
|
||||
name: create soundset without contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/soundsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
name: 'api_test soundset name 2'
|
||||
description: 'api_test soundset description'
|
||||
contract_default: 1
|
||||
copy_from_default: 1
|
||||
language: 'en'
|
||||
override: 1
|
||||
loopplay: 1
|
||||
retain:
|
||||
soundsets_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create soundset without files
|
||||
-
|
||||
name: create soundset without files
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/soundsets/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
contract_id: ${customer_id}
|
||||
name: 'api_test soundset name 3'
|
||||
description: 'api_test soundset description'
|
||||
contract_default: 1
|
||||
copy_from_default: 0
|
||||
language: 'en'
|
||||
override: 1
|
||||
loopplay: 1
|
||||
retain:
|
||||
soundsets_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/soundsets/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put with files replacement
|
||||
-
|
||||
name: PUT with files replacement
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${soundsets_path1}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
reseller_id: 1
|
||||
contract_id: ${customer_id}
|
||||
name: 'api_test soundset name 1'
|
||||
description: 'api_test soundset description'
|
||||
contract_default: 1
|
||||
copy_from_default: 1
|
||||
language: 'en'
|
||||
override: 1
|
||||
loopplay: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for soundsets item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${soundsets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get soundsets
|
||||
-
|
||||
name: GET soundsets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${soundsets_path3}'
|
||||
retain:
|
||||
soundsets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{soundsets}->{_links};
|
||||
delete $retained->{soundsets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put soundsets
|
||||
-
|
||||
name: PUT soundsets
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${soundsets_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${soundsets}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get soundsets
|
||||
-
|
||||
name: GET soundsets
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${soundsets_path3}'
|
||||
retain:
|
||||
new_soundsets: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_soundsets}->{_links};
|
||||
delete $retained->{new_soundsets}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${soundsets}': ${new_soundsets}
|
||||
|
||||
#DELETE soundsets
|
||||
-
|
||||
name: DELETE soundsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${soundsets_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE soundsets
|
||||
-
|
||||
name: DELETE soundsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${soundsets_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE soundsets
|
||||
-
|
||||
name: DELETE soundsets
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${soundsets_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,420 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for subscriberregistrations
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/subscriberregistrations/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-subscriberregistrations
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create test domain
|
||||
-
|
||||
name: create test domain
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/domains/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: test${unique_id}.example.org
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
domain_path: header.location
|
||||
domain_id: header.location
|
||||
|
||||
#create a BillingProfile
|
||||
-
|
||||
name: create a BillingProfile
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/billingprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test profile ${unique_id}
|
||||
handle: test_profile_handle${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
|
||||
#create a Customer Contact
|
||||
-
|
||||
name: create a Customer Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/customercontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: cust_contact_first
|
||||
lastname: cust_contact_last
|
||||
email: cust_contact@custcontact.invalid
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
customer_contact_path: header.location
|
||||
customer_contact_id: header.location
|
||||
|
||||
#get CustomerContact
|
||||
-
|
||||
name: check CustomerContact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_contact_path}'
|
||||
retain:
|
||||
customer_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_type} = 'sipaccount';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create Customer
|
||||
-
|
||||
name: include create Customer
|
||||
type: include
|
||||
file: CreateCustomer.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_content} = {
|
||||
status => 'active',
|
||||
contact_id => $retained->{customer_contact_id},
|
||||
billing_profile_id => $retained->{billing_profile_id},
|
||||
type => 'sipaccount',
|
||||
max_subscribers => undef,
|
||||
external_id => undef
|
||||
};
|
||||
}
|
||||
|
||||
#create Subscriber
|
||||
-
|
||||
name: include create Subscriber
|
||||
type: include
|
||||
file: CreateSubscriber.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
my $cc = 800;
|
||||
my $ac = '1';
|
||||
my $sn = $retained->{unique_id};
|
||||
$retained->{subscriber_content} = {
|
||||
primary_number => { cc => $cc, ac => $ac, sn => $sn },
|
||||
domain_id => $retained->{domain_id},
|
||||
username => 'subscriber_' . '1' . '_'.$retained->{unique_id},
|
||||
password => 'subscriber_password',
|
||||
customer_id => $retained->{customer}->{id},
|
||||
};
|
||||
}
|
||||
|
||||
#create subscriberregistrations
|
||||
-
|
||||
name: create subscriberregistrations
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_1
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '0.5'
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create subscriberregistrations
|
||||
-
|
||||
name: create subscriberregistrations
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_2
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '0.5'
|
||||
expires: 1567412713
|
||||
enabled: 1
|
||||
retain:
|
||||
subscriberregistrations_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create subscriberregistrations
|
||||
-
|
||||
name: create subscriberregistrations
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_3
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '0.5'
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/subscriberregistrations/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for subscriberregistrations item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${subscriberregistrations_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#DELETE subscriberregistrations
|
||||
-
|
||||
name: DELETE subscriberregistrations
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriberregistrations_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE subscriberregistrations
|
||||
-
|
||||
name: DELETE subscriberregistrations
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriberregistrations_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE subscriberregistrations
|
||||
-
|
||||
name: DELETE subscriberregistrations
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriberregistrations_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#create subscriberregistrations
|
||||
-
|
||||
name: create subscriberregistrations
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_4
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '0.5'
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path4: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get subscriberregistrations
|
||||
-
|
||||
name: GET subscriberregistrations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriberregistrations_path4}'
|
||||
retain:
|
||||
subscriberregistrations: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{subscriberregistrations}->{_links};
|
||||
delete $retained->{subscriberregistrations}->{_embedded};
|
||||
delete $retained->{subscriberregistrations}->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put subscriberregistrations
|
||||
-
|
||||
name: PUT subscriberregistrations
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${subscriberregistrations_path4}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${subscriberregistrations}'
|
||||
retain:
|
||||
subscriberregistrations_path_updated: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get subscriberregistrations
|
||||
-
|
||||
name: GET subscriberregistrations
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriberregistrations_path_updated}'
|
||||
retain:
|
||||
new_subscriberregistrations: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_subscriberregistrations}->{_links};
|
||||
delete $retained->{new_subscriberregistrations}->{_embedded};
|
||||
delete $retained->{new_subscriberregistrations}->{id};
|
||||
delete $retained->{new_subscriberregistrations}->{expires};
|
||||
delete $retained->{subscriberregistrations}->{expires};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${subscriberregistrations}': ${new_subscriberregistrations}
|
||||
|
||||
#DELETE subscriberregistrations
|
||||
-
|
||||
name: DELETE subscriberregistrations
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriberregistrations_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#create subscriberregistrations with q > 1
|
||||
-
|
||||
name: create subscriberregistrations with q > 1
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_5
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '2'
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path5: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create subscriberregistrations with q < -1
|
||||
-
|
||||
name: create subscriberregistrations with q < -1
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_5
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '-2'
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path5: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#create subscriberregistrations without q
|
||||
-
|
||||
name: create subscriberregistrations without q
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_5
|
||||
subscriber_id: ${subscriber_id}
|
||||
expires: 1567412713
|
||||
retain:
|
||||
subscriberregistrations_path5: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create subscriberregistrations without expires
|
||||
-
|
||||
name: create subscriberregistrations without expires
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscriberregistrations/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
contact: test_6
|
||||
subscriber_id: ${subscriber_id}
|
||||
q: '0.5'
|
||||
retain:
|
||||
subscriberregistrations_path6: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#DELETE subscriberregistrations
|
||||
-
|
||||
name: DELETE subscriberregistrations
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriberregistrations_path5}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,349 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for subscribers
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/subscribers/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-subscribers
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#get a domain for testing
|
||||
-
|
||||
name: get a domain for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/domains/?page=1&rows=1&order_by=id&order_by_direction=desc'
|
||||
retain:
|
||||
domain: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $domain = $retained->{domain}->{'_embedded'}->{'ngcp:domains'}->[0];
|
||||
$retained->{domain} = $domain;
|
||||
$retained->{domain_id} = $domain->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${domain}.id': defined
|
||||
|
||||
#get a customer for testing
|
||||
-
|
||||
name: get a customer for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/customers/?page=1&rows=1&order_by=id&order_by_direction=desc'
|
||||
retain:
|
||||
customer: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $customer = $retained->{customer}->{'_embedded'}->{'ngcp:customers'}->[0];
|
||||
$retained->{customer} = $customer;
|
||||
$retained->{customer_id} = $customer->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${customer}.id': defined
|
||||
|
||||
#get a subscriberprofile for testing
|
||||
-
|
||||
name: get a subscriberprofile for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberprofiles/?page=1&rows=1&order_by=id&order_by_direction=desc'
|
||||
retain:
|
||||
subscriberprofile: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriberprofile = $retained->{subscriberprofile}->{'_embedded'}->{'ngcp:subscriberprofiles'}->[0];
|
||||
$retained->{subscriberprofile} = $subscriberprofile;
|
||||
$retained->{subscriberprofile_id} = $subscriberprofile->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriberprofile}.id': defined
|
||||
|
||||
#get a subscriberprofileset for testing
|
||||
-
|
||||
name: get a subscriberprofileset for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberprofilesets/?page=1&rows=1&order_by=id&order_by_direction=desc'
|
||||
retain:
|
||||
subscriberprofileset: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
my $subscriberprofileset = $retained->{subscriberprofileset}->{'_embedded'}->{'ngcp:subscriberprofilesets'}->[0];
|
||||
$retained->{subscriberprofileset} = $subscriberprofileset;
|
||||
$retained->{subscriberprofileset_id} = $subscriberprofileset->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${subscriberprofileset}.id': defined
|
||||
|
||||
#create subscriber
|
||||
-
|
||||
name: create subscriber
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscribers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
administrative: 0
|
||||
customer_id: ${customer_id}
|
||||
primary_number:
|
||||
ac: 12
|
||||
cc: 12
|
||||
sn: 12
|
||||
alias_numbers:
|
||||
-
|
||||
ac: 112
|
||||
cc: 112
|
||||
sn: 112
|
||||
username: 'api_test_username_1'
|
||||
password: 'api_test_password'
|
||||
webusername: 'api_test_webusername_1'
|
||||
webpassword: 'web_password_1'
|
||||
domain_id: ${domain_id}
|
||||
email: null
|
||||
external_id: null
|
||||
is_pbx_group: 0
|
||||
is_pbx_pilot: 1
|
||||
pbx_extension: '111'
|
||||
pbx_group_ids:
|
||||
- null
|
||||
pbx_groupmember_ids:
|
||||
- null
|
||||
profile_id: ${subscriberprofile_id}
|
||||
profile_set_id: ${subscriberprofileset_id}
|
||||
status: 'active'
|
||||
pbx_hunt_policy: 'parallel'
|
||||
pbx_hunt_timeout: '15'
|
||||
retain:
|
||||
subscriber_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create subscriber
|
||||
-
|
||||
name: create subscriber
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscribers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
administrative: 0
|
||||
customer_id: ${customer_id}
|
||||
primary_number:
|
||||
ac: 121
|
||||
cc: 12
|
||||
sn: 12
|
||||
alias_numbers:
|
||||
-
|
||||
ac: 111
|
||||
cc: 11
|
||||
sn: 11
|
||||
-
|
||||
ac: 112
|
||||
cc: 11
|
||||
sn: 11
|
||||
username: 'api_test_username_2'
|
||||
password: 'api_test_password'
|
||||
webusername: 'api_test_webusername_2'
|
||||
webpassword: 'web_password_1'
|
||||
domain_id: ${domain_id}
|
||||
email: null
|
||||
external_id: null
|
||||
is_pbx_group: 0
|
||||
is_pbx_pilot: 0
|
||||
pbx_extension: '222'
|
||||
pbx_group_ids:
|
||||
- null
|
||||
pbx_groupmember_ids:
|
||||
- null
|
||||
profile_id: ${subscriberprofile_id}
|
||||
profile_set_id: ${subscriberprofileset_id}
|
||||
status: 'active'
|
||||
pbx_hunt_policy: 'parallel'
|
||||
pbx_hunt_timeout: '15'
|
||||
retain:
|
||||
subscriber_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create subscriber
|
||||
-
|
||||
name: create subscriber
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscribers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
administrative: 0
|
||||
customer_id: ${customer_id}
|
||||
primary_number:
|
||||
ac: 12
|
||||
cc: 12
|
||||
sn: 12
|
||||
alias_numbers:
|
||||
-
|
||||
ac: 112
|
||||
cc: 112
|
||||
sn: 112
|
||||
username: 'api_test_username'
|
||||
password: 'api_test_password'
|
||||
webusername: 'api_test_webusername'
|
||||
webpassword: 'web_password_1'
|
||||
domain_id: ${domain_id}
|
||||
email: null
|
||||
external_id: null
|
||||
is_pbx_group: 0
|
||||
is_pbx_pilot: 0
|
||||
pbx_extension: '111'
|
||||
pbx_group_ids:
|
||||
- null
|
||||
pbx_groupmember_ids:
|
||||
- null
|
||||
profile_id: ${subscriberprofile_id}
|
||||
profile_set_id: ${subscriberprofileset_id}
|
||||
status: 'active'
|
||||
pbx_hunt_policy: 'parallel'
|
||||
pbx_hunt_timeout: '15'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
like:
|
||||
body.message: already exists
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for subscriber item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${subscriber_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get subscriber
|
||||
-
|
||||
name: GET subscriber
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_path2}'
|
||||
retain:
|
||||
subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{subscriber}->{_links};
|
||||
delete $retained->{subscriber}->{_embedded};
|
||||
delete $retained->{subscriber}->{modify_timestamp};
|
||||
delete $retained->{subscriber}->{create_timestamp};
|
||||
delete $retained->{subscriber}->{primary_number_id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put subscriber
|
||||
-
|
||||
name: PUT subscriber
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${subscriber_path2}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${subscriber}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get subscriber
|
||||
-
|
||||
name: GET subscriber
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_path2}'
|
||||
retain:
|
||||
new_subscriber: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_subscriber}->{_links};
|
||||
delete $retained->{new_subscriber}->{_embedded};
|
||||
delete $retained->{new_subscriber}->{modify_timestamp};
|
||||
delete $retained->{new_subscriber}->{create_timestamp};
|
||||
delete $retained->{new_subscriber}->{primary_number_id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${subscriber}': ${new_subscriber}
|
||||
|
||||
#DELETE subscriber
|
||||
-
|
||||
name: DELETE subscriber
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriber_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE subscriber
|
||||
-
|
||||
name: DELETE subscriber
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${subscriber_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,492 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for systemcontacts
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/systemcontacts/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-systemcontacts
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create a System Contact
|
||||
-
|
||||
name: create a System Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first1
|
||||
lastname: sys_contact_last1
|
||||
email: sys_contact1@syscontact.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
system_contact_path1: header.location
|
||||
|
||||
#create a System Contact
|
||||
-
|
||||
name: create a System Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first2
|
||||
lastname: sys_contact_last2
|
||||
email: sys_contact2@syscontact.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
system_contact_path2: header.location
|
||||
|
||||
#create a System Contact
|
||||
-
|
||||
name: create a System Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first3
|
||||
lastname: sys_contact_last3
|
||||
email: sys_contact3@syscontact.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
system_contact_path3: header.location
|
||||
|
||||
#create a System Contact without email
|
||||
-
|
||||
name: create a System Contact without email
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first4
|
||||
lastname: sys_contact_last4
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
body.code: 422
|
||||
like:
|
||||
body.message: field='email'
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/systemcontacts/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for systemcontacts item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${system_contact_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get systemcontact
|
||||
-
|
||||
name: GET systemcontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${system_contact_path3}'
|
||||
retain:
|
||||
system_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{system_contact}->{_links};
|
||||
delete $retained->{system_contact}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${system_contact}.id': defined
|
||||
'${system_contact}.email': defined
|
||||
'${system_contact}.firstname': defined
|
||||
'${system_contact}.lastname': defined
|
||||
'${system_contact}.reseller_id': undefined
|
||||
like:
|
||||
'${system_contact}.id': '[0-9]+'
|
||||
|
||||
#put system_contact with missing content type
|
||||
-
|
||||
name: PUT system_contact with missing content type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put system_contact with unsuported content type
|
||||
-
|
||||
name: PUT system_contact with unsuported content type
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/xxx
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#put system_contact with no body
|
||||
-
|
||||
name: PUT system_contact with no body
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
|
||||
#put systemcontact
|
||||
-
|
||||
name: PUT systemcontact
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${system_contact}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get systemcontact
|
||||
-
|
||||
name: GET systemcontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${system_contact_path3}'
|
||||
retain:
|
||||
new_system_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_system_contact}->{_links};
|
||||
delete $retained->{new_system_contact}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${system_contact}': ${new_system_contact}
|
||||
|
||||
#get systemcontact
|
||||
-
|
||||
name: GET systemcontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${system_contact_path3}'
|
||||
retain:
|
||||
system_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{system_contact}->{_links};
|
||||
delete $retained->{system_contact}->{_embedded};
|
||||
$retained->{reseller_id} = 1;
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check if a system contact with reseller has no resellers link
|
||||
-
|
||||
name: check if a system contact with reseller has no resellers link
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${system_contact}'
|
||||
retain:
|
||||
new_system_contact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${new_system_contact}.reseller_id': undefined
|
||||
'${new_system_contact}._links.ngcp:resellers': undefined
|
||||
|
||||
#PATCH systemcontact
|
||||
-
|
||||
name: PATCH systemcontact
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /firstname
|
||||
value: patchedfirst
|
||||
retain:
|
||||
patched_reseller: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${patched_reseller}.firstname': 'patchedfirst'
|
||||
|
||||
#PATCH systemcontact with undef name
|
||||
-
|
||||
name: PATCH systemcontact with undef name
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /firstname
|
||||
value: null
|
||||
retain:
|
||||
patched_reseller: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${patched_reseller}.firstname': undefined
|
||||
|
||||
#PATCH systemcontact with no emil
|
||||
-
|
||||
name: PATCH systemcontact with no emil
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${system_contact_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /email
|
||||
value: null
|
||||
retain:
|
||||
patched_reseller: body
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#DELETE systemcontacts
|
||||
-
|
||||
name: DELETE systemcontacts
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${system_contact_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE systemcontacts
|
||||
-
|
||||
name: DELETE systemcontacts
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${system_contact_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE systemcontacts
|
||||
-
|
||||
name: DELETE systemcontacts
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${system_contact_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#create domain
|
||||
-
|
||||
name: create domain
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/domains/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: api_test.api_test${unique_id}
|
||||
reseller_id: 1
|
||||
retain:
|
||||
domain_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get domain
|
||||
-
|
||||
name: GET domain
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${domain_path}'
|
||||
retain:
|
||||
domain: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create billingprofile
|
||||
-
|
||||
name: create billingprofile
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/billingprofiles/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
reseller_id: 1
|
||||
handle: test_profile_${unique_id}
|
||||
name: test profile ${unique_id}
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create a System Contact
|
||||
-
|
||||
name: create a System Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/systemcontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: sys_contact_first4
|
||||
lastname: sys_contact_last4
|
||||
email: sys_contact4@syscontact.invalid
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
system_contact_id: header.location
|
||||
system_contact_path4: header.location
|
||||
|
||||
#create contract
|
||||
-
|
||||
name: create contract
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/contracts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
status: active
|
||||
contact_id: ${system_contact_id}
|
||||
type: reseller
|
||||
billing_profile_id: ${billing_profile_id}
|
||||
retain:
|
||||
contract_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#DELETE systemcontacts
|
||||
-
|
||||
name: DELETE systemcontacts
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${system_contact_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 423
|
||||
|
||||
#get systemcontact
|
||||
-
|
||||
name: GET systemcontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${system_contact_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#PATCH contract status terminated
|
||||
-
|
||||
name: PATCH contract status terminated
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/contracts/${contract_id}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /status
|
||||
value: terminated
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE systemcontacts
|
||||
-
|
||||
name: DELETE systemcontacts
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${system_contact_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get systemcontact
|
||||
-
|
||||
name: GET systemcontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${system_contact_path4}'
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
@ -0,0 +1,300 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for trustedsources
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/trustedsources/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-trustedsources
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create test domain
|
||||
-
|
||||
name: create test domain
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/domains/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
domain: test${unique_id}.example.org
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
domain_path: header.location
|
||||
domain_id: header.location
|
||||
|
||||
#create a BillingProfile
|
||||
-
|
||||
name: create a BillingProfile
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/billingprofiles/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
name: test profile ${unique_id}
|
||||
handle: test_profile_handle${unique_id}
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
billing_profile_id: header.location
|
||||
|
||||
#create a Customer Contact
|
||||
-
|
||||
name: create a Customer Contact
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/customercontacts/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
firstname: cust_contact_first
|
||||
lastname: cust_contact_last
|
||||
email: cust_contact@custcontact.invalid
|
||||
reseller_id: 1
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
customer_contact_path: header.location
|
||||
customer_contact_id: header.location
|
||||
|
||||
#get CustomerContact
|
||||
-
|
||||
name: check CustomerContact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_contact_path}'
|
||||
retain:
|
||||
customer_contact: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_type} = 'sipaccount';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create Customer
|
||||
-
|
||||
name: include create Customer
|
||||
type: include
|
||||
file: CreateCustomer.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{customer_content} = {
|
||||
status => 'active',
|
||||
contact_id => $retained->{customer_contact_id},
|
||||
billing_profile_id => $retained->{billing_profile_id},
|
||||
type => 'sipaccount',
|
||||
max_subscribers => undef,
|
||||
external_id => undef
|
||||
};
|
||||
}
|
||||
|
||||
#create Subscriber
|
||||
-
|
||||
name: include create Subscriber
|
||||
type: include
|
||||
file: CreateSubscriber.yaml
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
my $cc = 800;
|
||||
my $ac = '1';
|
||||
my $sn = $retained->{unique_id};
|
||||
$retained->{subscriber_content} = {
|
||||
primary_number => { cc => $cc, ac => $ac, sn => $sn },
|
||||
domain_id => $retained->{domain_id},
|
||||
username => 'subscriber_' . '1' . '_'.$retained->{unique_id},
|
||||
password => 'subscriber_password',
|
||||
customer_id => $retained->{customer}->{id},
|
||||
};
|
||||
}
|
||||
|
||||
#create trustedsources
|
||||
-
|
||||
name: create trustedsources
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/trustedsources/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
protocol: 'UDP'
|
||||
src_ip: '1.2.3.4'
|
||||
from_pattern: '^sip:test@example.org'
|
||||
retain:
|
||||
trustedsources_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create trustedsources
|
||||
-
|
||||
name: create trustedsources
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/trustedsources/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
protocol: 'UDP'
|
||||
src_ip: '1.2.3.5'
|
||||
from_pattern: '^sip:test@example.org'
|
||||
retain:
|
||||
trustedsources_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create trustedsources
|
||||
-
|
||||
name: create trustedsources
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/trustedsources/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
subscriber_id: ${subscriber_id}
|
||||
protocol: 'UDP'
|
||||
src_ip: '1.2.3.6'
|
||||
from_pattern: '^sip:test@example.org'
|
||||
retain:
|
||||
trustedsources_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/trustedsources/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for trustedsources item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${trustedsources_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get trustedsources
|
||||
-
|
||||
name: GET trustedsources
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${trustedsources_path3}'
|
||||
retain:
|
||||
trustedsources: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{trustedsources}->{_links};
|
||||
delete $retained->{trustedsources}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put trustedsources
|
||||
-
|
||||
name: PUT trustedsources
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${trustedsources_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${trustedsources}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get trustedsources
|
||||
-
|
||||
name: GET trustedsources
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${trustedsources_path3}'
|
||||
retain:
|
||||
new_trustedsources: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_trustedsources}->{_links};
|
||||
delete $retained->{new_trustedsources}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${trustedsources}': ${new_trustedsources}
|
||||
|
||||
#DELETE trustedsources
|
||||
-
|
||||
name: DELETE trustedsources
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${trustedsources_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE trustedsources
|
||||
-
|
||||
name: DELETE trustedsources
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${trustedsources_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE trustedsources
|
||||
-
|
||||
name: DELETE trustedsources
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${trustedsources_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
@ -0,0 +1,30 @@
|
||||
---
|
||||
#Check Event History
|
||||
-
|
||||
name: Check Event History
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${eventhistory_path}'
|
||||
retain:
|
||||
event_history: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
|
||||
my $i = 0;
|
||||
$retained->{got1_subscriber_id} = $retained->{event_history}->{_embedded}->{'ngcp:events'}->[0]->{subscriber_id};
|
||||
$retained->{got1_type} = $retained->{event_history}->{_embedded}->{'ngcp:events'}->[0]->{type};
|
||||
$retained->{got2_subscriber_id} = $retained->{event_history}->{_embedded}->{'ngcp:events'}->[1]->{subscriber_id};
|
||||
$retained->{got2_type} = $retained->{event_history}->{_embedded}->{'ngcp:events'}->[1]->{type};
|
||||
$retained->{expected1_subscriber_id} = $retained->{expected_events}->[0]->{subscriber_id};
|
||||
$retained->{expected1_type} = $retained->{expected_events}->[0]->{type};
|
||||
$retained->{expected2_subscriber_id} = $retained->{expected_events}->[1]->{subscriber_id};
|
||||
$retained->{expected2_type} = $retained->{expected_events}->[1]->{type};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
'${got1_subscriber_id}': '${expected1_subscriber_id}'
|
||||
'${got1_type}': '${expected1_type}'
|
||||
'${got2_subscriber_id}': '${expected2_subscriber_id}'
|
||||
'${got2_type}': '${expected2_type}'
|
||||
@ -0,0 +1,27 @@
|
||||
---
|
||||
#create Customer
|
||||
-
|
||||
name: create Customer
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: '${customer_content}'
|
||||
retain:
|
||||
customer_path: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get customer
|
||||
-
|
||||
name: GET customer
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customer_path}'
|
||||
retain:
|
||||
customer: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,28 @@
|
||||
---
|
||||
#create CustomerContact
|
||||
-
|
||||
name: create CustomerContact
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/customercontacts/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: '${customercontact_content}'
|
||||
retain:
|
||||
customercontact_path: header.location
|
||||
customercontact_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get customercontact
|
||||
-
|
||||
name: GET customercontact
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${customercontact_path}'
|
||||
retain:
|
||||
customercontact: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,28 @@
|
||||
---
|
||||
#create Subscriber
|
||||
-
|
||||
name: create Subscriber
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/subscribers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: '${subscriber_content}'
|
||||
retain:
|
||||
subscriber_path: header.location
|
||||
subscriber_id: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get subscriber
|
||||
-
|
||||
name: GET subscriber
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${subscriber_path}'
|
||||
retain:
|
||||
subscriber: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,26 @@
|
||||
---
|
||||
#set Call Forwards
|
||||
-
|
||||
name: set Call Forwards
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/api/callforwards/${subscriber_id}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${callforwards_content}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get Call Forwards
|
||||
-
|
||||
name: GET Call Forwards
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/callforwards/${subscriber_id}'
|
||||
retain:
|
||||
callforwards: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
@ -0,0 +1,132 @@
|
||||
---
|
||||
#check patch missing media type
|
||||
-
|
||||
name: check patch missing media type
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#check patch invalid media type
|
||||
-
|
||||
name: check patch invalid media type
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/xxx
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 415
|
||||
|
||||
#check patch missing body
|
||||
-
|
||||
name: check patch missing body
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: is missing a message body
|
||||
|
||||
#check patch no array body
|
||||
-
|
||||
name: check patch no array body
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
content:
|
||||
foo: bar
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: must be an array
|
||||
|
||||
#check patch no op in body
|
||||
-
|
||||
name: check patch no op in body
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
content:
|
||||
-
|
||||
foo: bar
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: must have an 'op' field
|
||||
|
||||
#check patch invalid op in body
|
||||
-
|
||||
name: check patch invalid op in body
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
content:
|
||||
-
|
||||
op: bar
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: Invalid PATCH op
|
||||
|
||||
#check patch missing fields for op
|
||||
-
|
||||
name: check patch missing fields for op
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: Missing PATCH keys
|
||||
|
||||
#check patch extra fields for op
|
||||
-
|
||||
name: check patch extra fields for op
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/api/systemcontacts/1'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=minimal
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /foo
|
||||
value: bar
|
||||
invalid: sna
|
||||
conditions:
|
||||
is:
|
||||
code: 400
|
||||
like:
|
||||
body.message: Invalid PATCH key
|
||||
@ -0,0 +1,288 @@
|
||||
---
|
||||
#check options
|
||||
-
|
||||
name: check OPTIONS for vouchers
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: /api/vouchers/
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
header:
|
||||
Accept-Post: application/hal+json; profile=http://purl.org/sipwise/ngcp-api/#rel-vouchers
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- POST
|
||||
|
||||
#create vouchers
|
||||
-
|
||||
name: create vouchers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 100
|
||||
code: 'apitestcode_1'
|
||||
customer_id: null
|
||||
package_id: null
|
||||
reseller_id: 1
|
||||
valid_until: '2037-01-01 12:00:00'
|
||||
retain:
|
||||
vouchers_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create vouchers
|
||||
-
|
||||
name: create vouchers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 100
|
||||
code: 'apitestcode_2'
|
||||
customer_id: null
|
||||
package_id: null
|
||||
reseller_id: 1
|
||||
valid_until: '2037-01-01 12:00:00'
|
||||
retain:
|
||||
vouchers_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create vouchers
|
||||
-
|
||||
name: create vouchers
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content: &content
|
||||
amount: 100
|
||||
code: 'apitestcode_3'
|
||||
customer_id: null
|
||||
package_id: null
|
||||
reseller_id: 1
|
||||
valid_until: '2037-01-01 12:00:00'
|
||||
retain:
|
||||
vouchers_path3: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#create voucher with same voucher code again
|
||||
-
|
||||
name: create voucher with same voucher code again
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 100
|
||||
code: 'apitestcode_1'
|
||||
customer_id: null
|
||||
package_id: null
|
||||
reseller_id: 1
|
||||
valid_until: '2037-01-01 12:00:00'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#get vouchers
|
||||
-
|
||||
name: GET vouchers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${vouchers_path3}'
|
||||
retain:
|
||||
vouchers3: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{vouchers3}->{id};
|
||||
delete $retained->{vouchers3}->{_links};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${vouchers3}': *content
|
||||
|
||||
#patch vouchers
|
||||
-
|
||||
name: patch vouchers
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${vouchers_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /code
|
||||
value: 'apitestcode_3'
|
||||
retain:
|
||||
modified_voucher: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{modified_voucher}->{id};
|
||||
delete $retained->{modified_voucher}->{_links};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${vouchers3}': '${modified_voucher}'
|
||||
|
||||
#patch vouchers with invalid valid_until
|
||||
-
|
||||
name: patch vouchers with invalid valid_until
|
||||
type: item
|
||||
method: PATCH
|
||||
path: '/${vouchers_path3}'
|
||||
header:
|
||||
Content-Type: application/json-patch+json
|
||||
Prefer: return=representation
|
||||
content:
|
||||
-
|
||||
op: replace
|
||||
path: /valid_until
|
||||
value: '2099-01-01 00:00:00'
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#verify pagination
|
||||
-
|
||||
name: verify pagination
|
||||
type: pagination
|
||||
method: GET
|
||||
path: '/api/vouchers/?page=1&rows=2'
|
||||
retain:
|
||||
collection: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#check options on item
|
||||
-
|
||||
name: check OPTIONS for vouchers item
|
||||
type: item
|
||||
method: OPTIONS
|
||||
path: '/${vouchers_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
options:
|
||||
- GET
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
|
||||
#get vouchers
|
||||
-
|
||||
name: GET vouchers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${vouchers_path3}'
|
||||
retain:
|
||||
vouchers: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{vouchers}->{_links};
|
||||
delete $retained->{vouchers}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put vouchers
|
||||
-
|
||||
name: PUT vouchers
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/${vouchers_path3}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${vouchers}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get vouchers
|
||||
-
|
||||
name: GET vouchers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${vouchers_path3}'
|
||||
retain:
|
||||
new_vouchers: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
delete $retained->{new_vouchers}->{_links};
|
||||
delete $retained->{new_vouchers}->{_embedded};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
is_deeply:
|
||||
'${vouchers}': ${new_vouchers}
|
||||
|
||||
#DELETE vouchers
|
||||
-
|
||||
name: DELETE vouchers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${vouchers_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE vouchers
|
||||
-
|
||||
name: DELETE vouchers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${vouchers_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#DELETE vouchers
|
||||
-
|
||||
name: DELETE vouchers
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${vouchers_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get vouchers
|
||||
-
|
||||
name: get vouchers
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${vouchers_path3}'
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
Loading…
Reference in new issue