+subscriber instead of source_subscriber typo fixed +rudimentary test case to see if the filter works +fixed in/out direction filter testcase: sum of in and out calls should be >= total count of calls Change-Id: Ibe4b8153f023c53bb463626ad9e6613992fc101dchanges/36/3236/3
parent
74333c94ee
commit
59339ffc89
@ -0,0 +1,33 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
use Test::Collection;
|
||||
|
||||
my $test_machine = Test::Collection->new(
|
||||
name => 'calls',
|
||||
);
|
||||
|
||||
diag('Note that the next tests require at least one subscriber to be present');
|
||||
|
||||
SKIP:
|
||||
{ #MT#16171
|
||||
my ($res,$sub1,$sub1_id,$sub1_user,$sub1_pass,$cl_collection, $cl_collection_in, $cl_collection_out);
|
||||
|
||||
($res, $sub1) = $test_machine->check_item_get('/api/subscribers/?page=1&rows=1&order_by=id&order_by_direction=desc',"fetch a subscriber for testing");
|
||||
if ($sub1->{total_count} < 1) {
|
||||
skip("Precondition not met: need a subscriber",1);
|
||||
}
|
||||
($sub1_id) = $sub1->{_embedded}->{'ngcp:subscribers'}->{_links}{self}{href} =~ m!subscribers/([0-9]*)$!;
|
||||
|
||||
cmp_ok ($sub1_id, '>', 0, "should be positive integer");
|
||||
|
||||
($res, $cl_collection) = $test_machine->check_item_get('/api/calls/?page=1&rows=10&subscriber_id='.$sub1_id,"fetch calls collection of subscriber ($sub1_id) by filter");
|
||||
|
||||
diag("Total number of calls: " . $cl_collection->{total_count});
|
||||
|
||||
}
|
||||
|
||||
done_testing;
|
||||
|
||||
# vim: set tabstop=4 expandtab:
|
Loading…
Reference in new issue