File Coverage

blib/lib/App/Dochazka/CLI/Commands/RestTest/Activity.pm
Criterion Covered Total %
statement 22 31 70.9
branch n/a
condition n/a
subroutine 7 10 70.0
pod n/a
total 29 41 70.7


line stmt bran cond sub pod time code
1             # *************************************************************************
2             # Copyright (c) 2014-2016, SUSE LLC
3             #
4             # All rights reserved.
5             #
6             # Redistribution and use in source and binary forms, with or without
7             # modification, are permitted provided that the following conditions are met:
8             #
9             # 1. Redistributions of source code must retain the above copyright notice,
10             # this list of conditions and the following disclaimer.
11             #
12             # 2. Redistributions in binary form must reproduce the above copyright
13             # notice, this list of conditions and the following disclaimer in the
14             # documentation and/or other materials provided with the distribution.
15             #
16             # 3. Neither the name of SUSE LLC nor the names of its contributors may be
17             # used to endorse or promote products derived from this software without
18             # specific prior written permission.
19             #
20             # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21             # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22             # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23             # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24             # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25             # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26             # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27             # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28             # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29             # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30             # POSSIBILITY OF SUCH DAMAGE.
31             # *************************************************************************
32             #
33              
34 20     20   273 use 5.012;
  20         45  
35 20     20   86 use strict;
  20         21  
  20         374  
36 20     20   58 use warnings;
  20         21  
  20         4790  
37              
38              
39             # $METHOD activity
40             sub _method_activity {
41 0     0   0 my ( $ts, $th ) = @_;
42 0         0 my $method = $ts->[0];
43              
44 0         0 return [ $method, "activity", $th->{_REST} ];
45             }
46              
47             # $METHOD activity aid $JSON
48             sub _method_activity_aid {
49 0     0   0 my ( $ts, $th ) = @_;
50 0         0 my $method = $ts->[0];
51              
52 0         0 return [ $method, "activity/aid", $th->{_JSON} ];
53             }
54              
55             # $METHOD activity aid $AID [$JSON]
56             sub _method_activity_aid_num {
57 8     8   2866 my ( $ts, $th ) = @_;
58 8         15 my $method = $ts->[0];
59 8         14 my $num = $th->{_NUM};
60              
61 8         39 return [ $method, "activity/aid/$num", $th->{_REST} ];
62             }
63              
64             # $METHOD activity all
65             sub _method_activity_all {
66 8     8   2945 my ( $ts, $th ) = @_;
67 8         16 my $method = $ts->[0];
68              
69 8         37 return [ $method, "activity/all", $th->{_REST} ];
70             }
71              
72             # $METHOD activity all disabled
73             sub _method_activity_all_disabled {
74 8     8   2856 my ( $ts, $th ) = @_;
75 8         18 my $method = $ts->[0];
76              
77 8         35 return [ $method, "activity/all/disabled", $th->{_REST} ];
78             }
79              
80             # $METHOD activity code $JSON
81             sub _method_activity_code {
82 0     0   0 my ( $ts, $th ) = @_;
83 0         0 my $method = $ts->[0];
84              
85 0         0 return [ $method, "activity/code", $th->{_JSON} ];
86             }
87              
88             # $METHOD activity code $CODE [$JSON]
89             sub _method_activity_code_term {
90 8     8   2913 my ( $ts, $th ) = @_;
91 8         18 my $method = $ts->[0];
92 8         10 my $code = $th->{_TERM};
93              
94 8         40 return [ $method, "activity/code/$code", $th->{_REST} ];
95             }
96              
97             1;