* Add warning system: throw warnings whenever a variable is wanted but not present * Migrate api-journals and api-topupvoucher Change-Id: Iefb6f4f3ebe7d11f904d21a6d255e7940e8bb07achanges/95/33795/6
parent
16d34fa282
commit
c280b171ba
@ -0,0 +1,128 @@
|
||||
---
|
||||
#create Lnp Provider
|
||||
-
|
||||
name: create Lnp Provider
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/lnpcarriers/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
name: test_lnp_carrier_${unique_id}
|
||||
prefix: test${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
lnp_provider_path: header.location
|
||||
lnp_provider_id: header.location
|
||||
|
||||
#get Lnp Provider
|
||||
-
|
||||
name: GET Lnp Provider
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${lnp_provider_path}'
|
||||
retain:
|
||||
lnp_provider: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create Lnp Number
|
||||
-
|
||||
name: create Lnp Number
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/lnpnumbers/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
carrier_id: ${lnp_provider_id}
|
||||
number: 123${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
lnp_number_path1: header.location
|
||||
|
||||
#get Lnp Number
|
||||
-
|
||||
name: GET Lnp Number
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${lnp_number_path1}'
|
||||
retain:
|
||||
lnp_nubmer1: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create Lnp Number
|
||||
-
|
||||
name: create Lnp Number
|
||||
type: item
|
||||
method: POST
|
||||
path: /api/lnpnumbers/
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
carrier_id: ${lnp_provider_id}
|
||||
number: 456${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
retain:
|
||||
lnp_number_path2: header.location
|
||||
|
||||
#get Lnp Number
|
||||
-
|
||||
name: GET Lnp Number
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${lnp_number_path2}'
|
||||
retain:
|
||||
lnp_nubmer2: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#DELETE Lnp Number
|
||||
-
|
||||
name: DELETE Lnp Number
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${lnp_number_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get Lnp Number
|
||||
-
|
||||
name: GET Lnp Number
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${lnp_number_path1}'
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
||||
|
||||
#DELETE Lnp Number
|
||||
-
|
||||
name: DELETE Lnp Number
|
||||
type: item
|
||||
method: DELETE
|
||||
path: '/${lnp_number_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#get Lnp Number
|
||||
-
|
||||
name: GET Lnp Number
|
||||
type: item
|
||||
method: GET
|
||||
path: '/${lnp_number_path2}'
|
||||
conditions:
|
||||
is:
|
||||
code: 404
|
@ -0,0 +1,142 @@
|
||||
---
|
||||
#get a subscriber for testing
|
||||
-
|
||||
name: get a subscriber for testing
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscribers/?page=1&rows=1&order_by=id&order_by_direction=desc'
|
||||
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 Subscriber Preferences
|
||||
-
|
||||
name: GET Subscriber Preferences
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberpreferences/${subscriber_id}'
|
||||
retain:
|
||||
subscriberpreferences: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get Subscriber Preferencedefs
|
||||
-
|
||||
name: GET Subscriber Preferencedefs
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberpreferencedefs'
|
||||
retain:
|
||||
defs: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put Subscriber Preferences
|
||||
-
|
||||
name: PUT Subscriber Preferences
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/api/subscriberpreferences/${subscriber_id}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${subscriberpreferences}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get Subscriber Preferences
|
||||
-
|
||||
name: GET Subscriber Preferences
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/subscriberpreferences/${subscriber_id}'
|
||||
retain:
|
||||
subscriberpreferences: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#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 domain Preferences
|
||||
-
|
||||
name: GET domain Preferences
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/domainpreferences/${domain_id}'
|
||||
retain:
|
||||
domainpreferences: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get domain Preferencedefs
|
||||
-
|
||||
name: GET domain Preferencedefs
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/domainpreferencedefs'
|
||||
retain:
|
||||
defs: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#put domain Preferences
|
||||
-
|
||||
name: PUT domain Preferences
|
||||
type: item
|
||||
method: PUT
|
||||
path: '/api/domainpreferences/${domain_id}'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
Prefer: return=representation
|
||||
content: '${domainpreferences}'
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#get domain Preferences
|
||||
-
|
||||
name: GET domain Preferences
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/domainpreferences/${domain_id}'
|
||||
retain:
|
||||
domainpreferences: body
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
@ -0,0 +1,493 @@
|
||||
---
|
||||
#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
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create a Domain
|
||||
-
|
||||
name: create a 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
|
||||
|
||||
#get Domain
|
||||
-
|
||||
name: check 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:
|
||||
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 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->{billingprofile_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->{customer_id} = $retained->{customer}->{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 voucher
|
||||
-
|
||||
name: create voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 1000.0
|
||||
code: test_voucher_1${unique_id}
|
||||
customer_id: ${customer_id}
|
||||
reseller_id: 1
|
||||
valid_until: '2037-01-01 00:00:00'
|
||||
retain:
|
||||
voucher_path1: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get Voucher
|
||||
-
|
||||
name: get Voucher
|
||||
type: item
|
||||
method: GET
|
||||
path: '${voucher_path1}'
|
||||
retain:
|
||||
voucher1: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{voucher1_code} = $retained->{voucher1}->{code};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#create voucher
|
||||
-
|
||||
name: create voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/vouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 1000.0
|
||||
code: test_voucher_2${unique_id}
|
||||
customer_id: ${customer_id}
|
||||
reseller_id: 1
|
||||
valid_until: '2010-01-01 00:00:00'
|
||||
retain:
|
||||
voucher_path2: header.location
|
||||
conditions:
|
||||
is:
|
||||
code: 201
|
||||
|
||||
#get Voucher
|
||||
-
|
||||
name: get Voucher
|
||||
type: item
|
||||
method: GET
|
||||
path: '${voucher_path2}'
|
||||
retain:
|
||||
voucher2: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{voucher2_code} = $retained->{voucher2}->{code};
|
||||
$retained->{subscriber_id} = $retained->{subscriber}->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
|
||||
#perform topup cash
|
||||
-
|
||||
name: perform topup cash
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupcash/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 0.5
|
||||
package_id: null
|
||||
subscriber_id: invalid
|
||||
request_token: 1${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=1${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "1$retained->{unique_id}";
|
||||
$retained->{expected_outcome} = 'failed';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': '${expected_outcome}'
|
||||
like:
|
||||
'${topuplogs}.message': "Validation failed. field='subscriber_id'"
|
||||
|
||||
#perform topup cash
|
||||
-
|
||||
name: perform topup cash
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupcash/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 'invalid_amount'
|
||||
package_id: null
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 2${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=2${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "2$retained->{unique_id}";
|
||||
$retained->{expected_outcome} = 'failed';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': '${expected_outcome}'
|
||||
like:
|
||||
'${topuplogs}.message': "Value cannot be converted to money"
|
||||
|
||||
#perform topup cash
|
||||
-
|
||||
name: perform topup cash
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupcash/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
amount: 50
|
||||
package_id:
|
||||
id : invalid
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 3${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=3${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "3$retained->{unique_id}";
|
||||
$retained->{expected_outcome} = 'failed';
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': '${expected_outcome}'
|
||||
like:
|
||||
'${topuplogs}.message': "Validation failed. field='package_id'"
|
||||
|
||||
#perform topup voucher
|
||||
-
|
||||
name: perform topup voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupvouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
code: invalid
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 4${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=4${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "4$retained->{unique_id}";
|
||||
$retained->{expected_outcome} = 'failed';
|
||||
$retained->{long_request_token} = 'a' x 256;
|
||||
$retained->{expected_request_token} = substr($retained->{long_request_token},0,255);
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': '${expected_outcome}'
|
||||
like:
|
||||
'${topuplogs}.message': "Invalid voucher code 'invalid'"
|
||||
|
||||
#perform topup voucher
|
||||
-
|
||||
name: perform topup voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupvouchers/'
|
||||
header:
|
||||
|
||||
Content-Type: application/json
|
||||
content:
|
||||
code: ${voucher1_code}
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: ${long_request_token}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=${expected_request_token}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_request_token}'
|
||||
'${topuplogs}.outcome': 'failed'
|
||||
like:
|
||||
'${topuplogs}.message': "Validation failed. field='request_token'"
|
||||
|
||||
#perform topup voucher
|
||||
-
|
||||
name: perform topup voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupvouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
code: ${voucher1_code}
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 5${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 204
|
||||
|
||||
#perform same topup voucher
|
||||
-
|
||||
name: perform same topup voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupvouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
code: ${voucher1_code}
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 6${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=6${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "6$retained->{unique_id}";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': 'failed'
|
||||
like:
|
||||
'${topuplogs}.message': "already used"
|
||||
|
||||
#perform same topup voucher
|
||||
-
|
||||
name: perform same topup voucher
|
||||
type: item
|
||||
method: POST
|
||||
path: '/api/topupvouchers/'
|
||||
header:
|
||||
Content-Type: application/json
|
||||
content:
|
||||
code: ${voucher2_code}
|
||||
subscriber_id: ${subscriber_id}
|
||||
request_token: 7${unique_id}
|
||||
conditions:
|
||||
is:
|
||||
code: 422
|
||||
|
||||
#check topuplog
|
||||
-
|
||||
name: check topuplog
|
||||
type: item
|
||||
method: GET
|
||||
path: '/api/topuplogs/?page=1&rows=10&order_by_direction=asc&order_by=timestamp&request_token=7${unique_id}'
|
||||
retain:
|
||||
topuplogs_result: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{topuplogs} = $retained->{topuplogs_result}->{_embedded}->{'ngcp:topuplogs'}->[0];
|
||||
$retained->{expected_token} = "7$retained->{unique_id}";
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
'${topuplogs}.request_token': '${expected_token}'
|
||||
'${topuplogs}.outcome': 'failed'
|
||||
like:
|
||||
'${topuplogs}.message': "expired"
|
@ -0,0 +1,37 @@
|
||||
---
|
||||
#check recent journalitem request
|
||||
-
|
||||
name: check recent journalitem request
|
||||
type: item
|
||||
method: GET
|
||||
path: /${journal_link}
|
||||
retain:
|
||||
journal: body
|
||||
perl_code: !!perl/code |
|
||||
{
|
||||
my ($retained) = @_;
|
||||
$retained->{links} = $retained->{journal}->{_links}->{'ngcp:'.$retained->{resource}};
|
||||
$retained->{href_resource} = ref $retained->{journal}->{_links}->{'ngcp:'.$retained->{resource}} eq 'ARRAY'
|
||||
? $retained->{journal}->{_links}->{'ngcp:'.$retained->{resource}}->[0]->{href}
|
||||
: $retained->{journal}->{_links}->{'ngcp:'.$retained->{resource}}->{href};
|
||||
$retained->{expected_href_resource} = '/api/'.$retained->{resource}.'/'.$retained->{item}->{id};
|
||||
delete $retained->{item}->{_links};
|
||||
$retained->{journal_item_link} = '/api/'. $retained->{resource} . '/' . $retained->{item}->{id} . '/journal/'.$retained->{journal}->{id};
|
||||
}
|
||||
conditions:
|
||||
is:
|
||||
code: 200
|
||||
ok:
|
||||
'${journal}.operation': '${operation}'
|
||||
'${journal}.id': defined
|
||||
'${journal}.operation': defined
|
||||
'${journal}.username': defined
|
||||
'${journal}.timestamp': defined
|
||||
'${journal}.content': defined
|
||||
'${journal}._links': defined
|
||||
'${journal}._links.self': defined
|
||||
'${journal}._links.collection': defined
|
||||
'${links}': defined
|
||||
'${href_resource}': '${expected_href_resource}'
|
||||
is_deeply:
|
||||
'${journal}.content': '${item}'
|
Loading…
Reference in new issue