5_0/Role/Scroll.pm untested

filter: Statementstmt 0.0% 0 / 41 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 58 CC 4 SCAR 18.3
CC
4
Cov
0%
scroll_request
12.0
DEMOLISH
6.0
BEGIN
2.0
CRAP 6.2
1 # Licensed to Elasticsearch B.V under one or more agreements.
2 # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3 # See the LICENSE file in the project root for more information
4  
5 package Search::Elasticsearch::Client::5_0::Role::Scroll;
6 $Search::Elasticsearch::Client::5_0::Role::Scroll::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::5_0::Role::Scroll::VERSION = '7.301';
9 use Moo::Role;
10 requires 'finish';
11 use Search::Elasticsearch::Util qw(parse_params throw);
12 use Devel::GlobalDestruction;
13 use namespace::clean;
14 has 'es' => ( is => 'ro', required => 1 );
15 has 'scroll' => ( is => 'ro' );
16 has 'scroll_in_qs' => ( is => 'ro' );
17 has 'total' => ( is => 'rwp' );
18 has 'max_score' => ( is => 'rwp' );
19 has 'facets' => ( is => 'rwp' );
20 has 'aggregations' => ( is => 'rwp' );
21 has 'suggest' => ( is => 'rwp' );
22 has 'took' => ( is => 'rwp' );
23 has 'total_took' => ( is => 'rwp' );
24 has 'search_params' => ( is => 'ro' );
25 has 'is_finished' => ( is => 'rwp', default => '' );
26 has '_pid' => ( is => 'ro', default => sub {$$} );
27 has '_scroll_id' => ( is => 'rwp', clearer => 1, predicate => 1 );
28  
29 #===================================
30 sub scroll_request {
31 #===================================
32 my $self = shift;
33 throw( 'Illegal',
34 'Scroll requests are not fork safe and may only be '
35 . 'refilled by the same process that created the instance.' )
36 if $self->_pid != $$;
37  
38 my %args = ( scroll => $self->scroll );
39 if ( $self->scroll_in_qs ) {
40 $args{scroll_id} = $self->_scroll_id;
41 }
42 else {
43 $args{body} = { scroll_id => $self->_scroll_id };
44 }
45 $self->es->scroll(%args);
46 }
47  
48 #===================================
49 sub DEMOLISH {
50 #===================================
51 my $self = shift or return;
52 return if in_global_destruction;
53 $self->finish;
54 }
55  
56 1;
57  
58 # ABSTRACT: Provides common functionality to L<Search::Elasticsearch::Client::5_0::Scroll> and L<Search::Elasticsearch::Client::5_0::Async::Scroll>
59  
60 __END__