diff --git a/t/api-rest/Dockerfile b/t/api-rest/Dockerfile index 0d7afd0740..b9cb2d4618 100644 --- a/t/api-rest/Dockerfile +++ b/t/api-rest/Dockerfile @@ -5,7 +5,7 @@ FROM docker.mgm.sipwise.com/sipwise-stretch:latest # is updated with the current date. It will force refresh of all # of the base images and things like `apt-get update` won't be using # old cached versions when the Dockerfile is built. -ENV REFRESHED_AT 2018-08-10 +ENV REFRESHED_AT 2018-08-14 # files that get-code generates COPY t/api-rest/sources.list.d/builddeps.list /etc/apt/sources.list.d/ diff --git a/t/api-rest/api-journals.t b/t/api-rest/api-journals.t index df4ee3c919..0fb2c27f6a 100644 --- a/t/api-rest/api-journals.t +++ b/t/api-rest/api-journals.t @@ -4,9 +4,6 @@ use Net::Domain qw(hostfqdn); use JSON -support_by_pp, -no_export; use Test::More; use Storable qw(); -use URI::Encode qw(uri_encode); -use DateTime qw(); -use DateTime::TimeZone qw(); use LWP::Debug; @@ -23,9 +20,7 @@ my $is_local_env = 0; my $mysql_sqlstrict = 1; #https://bugtracker.sipwise.com/view.php?id=12565 my $enable_journal_tests = 1; -my $test_start_datetime = DateTime->now( - time_zone => DateTime::TimeZone->new(name => 'local') -); +my $test_start_datetime; use Config::General; my $catalyst_config; @@ -2344,6 +2339,10 @@ sub _test_journal_top_journalitem { ok($journal->{operation} eq $op, "check expected journal operation"); ok(exists $journal->{username}, "check existence of username"); ok(exists $journal->{timestamp}, "check existence of timestamp"); + unless ($test_start_datetime) { + $test_start_datetime = $journal->{timestamp}; + diag($test_start_datetime); + } ok(exists $journal->{content}, "check existence of content"); ok(exists $journal->{_links}, "check existence of _links"); @@ -2404,7 +2403,7 @@ sub _test_journal_collection { my ($resource,$item_id,$journals) = @_; if (_is_journal_resource_enabled($resource)) { my $total_count = (defined $journals ? (scalar keys %$journals) : undef); - my $nexturi = $uri.'/api/'.$resource . '/' . $item_id . '/journal/?page=1&rows=' . ((not defined $total_count or $total_count <= 2) ? 2 : $total_count - 1) . "&from=".uri_encode($test_start_datetime); + my $nexturi = $uri.'/api/'.$resource . '/' . $item_id . '/journal/?page=1&rows=' . ((not defined $total_count or $total_count <= 2) ? 2 : $total_count - 1) . "&from=".$test_start_datetime; do { $res = $ua->get($nexturi); is($res->code, 200, _get_request_test_message("fetch journal collection page")); diff --git a/t/api-rest/control b/t/api-rest/control index 253e48b7d4..c4571cc0e0 100644 --- a/t/api-rest/control +++ b/t/api-rest/control @@ -22,5 +22,4 @@ Build-Depends: libboolean-perl, libtext-table-perl, libtime-warp-perl, libtrycatch-perl, - libuuid-perl, - liburi-encode-perl + libuuid-perl