You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/t/api-rest2/Utils/CheckEventHistory.yaml

30 lines
1.4 KiB

---
#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}'