File Coverage

blib/lib/App/Dochazka/CLI/Commands/RestTest/Employee.pm
Criterion Covered Total %
statement 60 82 73.1
branch n/a
condition n/a
subroutine 18 24 75.0
pod n/a
total 78 106 73.5


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   312 use 5.012;
  20         62  
35 20     20   104 use strict;
  20         41  
  20         374  
36 20     20   90 use warnings;
  20         34  
  20         14013  
37              
38             # $METHOD employee
39             sub _method_employee {
40 8     8   3808 my ( $ts, $th ) = @_;
41 8         20 my $method = $ts->[0];
42              
43 8         39 return [ $method, "employee", $th->{_REST} ];
44             }
45              
46             # $METHOD employee count
47             sub _method_employee_count {
48 8     8   3786 my ( $ts, $th ) = @_;
49 8         24 my $method = $ts->[0];
50              
51 8         35 return [ $method, "employee/count", $th->{_REST} ];
52             }
53              
54             # $METHOD employee count priv
55             sub _method_employee_count_priv {
56 8     8   3662 my ( $ts, $th ) = @_;
57 8         22 my $method = $ts->[0];
58              
59 8         39 return [ $method, "employee/count/priv", $th->{_REST} ];
60             }
61              
62             # $METHOD employee search
63             sub _method_employee_search {
64 8     8   3663 my ( $ts, $th ) = @_;
65 8         27 my $method = $ts->[0];
66              
67 8         37 return [ $method, "employee/search", $th->{_REST} ];
68             }
69              
70             # $METHOD employee search nick _TERM
71             sub _method_employee_search_nick {
72 8     8   3706 my ( $ts, $th ) = @_;
73 8         22 my $method = $ts->[0];
74 8         17 my $nick = $th->{_TERM};
75              
76 8         46 return [ $method, "employee/search/nick/$nick", $th->{_REST} ];
77             }
78              
79             # $METHOD employee self
80             sub _method_employee_self {
81 8     8   3722 my ( $ts, $th ) = @_;
82 8         29 my $method = $ts->[0];
83              
84 8         59 return [ $method, "employee/self", $th->{_REST} ];
85             }
86              
87             # $METHOD employee self full
88             sub _method_employee_self_full {
89 8     8   3674 my ( $ts, $th ) = @_;
90 8         25 my $method = $ts->[0];
91              
92 8         44 return [ $method, "employee/self/full", $th->{_REST} ];
93             }
94              
95             # $METHOD employee eid
96             sub _method_employee_eid {
97 4     4   1782 my ( $ts, $th ) = @_;
98 4         10 my $method = $ts->[0];
99              
100 4         17 return [ $method, "employee/eid", '' ];
101             }
102              
103             # $METHOD employee eid $JSON
104             sub _method_employee_eid_json {
105 4     4   1844 my ( $ts, $th ) = @_;
106 4         12 my $method = $ts->[0];
107              
108 4         23 return [ $method, "employee/eid", $th->{_JSON} ];
109             }
110              
111             # $METHOD employee eid $EID
112             sub _method_employee_eid_num {
113 4     4   1785 my ( $ts, $th ) = @_;
114 4         16 my $method = $ts->[0];
115 4         11 my $eid = $th->{_NUM};
116              
117 4         17 return [ $method, "employee/eid/$eid", '' ];
118             }
119              
120             # $METHOD employee eid $EID $JSON
121             sub _method_employee_eid_num_json {
122 4     4   1872 my ( $ts, $th ) = @_;
123 4         11 my $method = $ts->[0];
124 4         96 my $eid = $th->{_NUM};
125 4         13 my $json = $th->{_JSON};
126              
127 4         26 return [ $method, "employee/eid/$eid", $json ];
128             }
129              
130             # $METHOD employee eid $EID team
131             sub _method_employee_eid_num_team {
132 0     0   0 my ( $ts, $th ) = @_;
133 0         0 my $method = $ts->[0];
134 0         0 my $eid = $th->{_NUM};
135              
136 0         0 return [ $method, "employee/eid/$eid/team", '' ];
137             }
138              
139             # $METHOD employee list
140             sub _method_employee_list {
141 0     0   0 my ( $ts, $th ) = @_;
142 0         0 my $method = $ts->[0];
143              
144 0         0 return [ $method, "employee/list", '' ];
145             }
146              
147             # $METHOD employee list $PRIV
148             sub _method_employee_list_priv {
149 0     0   0 my ( $ts, $th ) = @_;
150 0         0 my $method = $ts->[0];
151 0         0 my $priv = $th->{_TERM};
152              
153 0         0 return [ $method, "employee/list/$priv", '' ];
154             }
155              
156             # $METHOD employee nick
157             sub _method_employee_nick {
158 4     4   1789 my ( $ts, $th ) = @_;
159 4         11 my $method = $ts->[0];
160              
161 4         15 return [ $method, "employee/nick", '' ];
162             }
163              
164             # $METHOD employee nick $JSON
165             sub _method_employee_nick_json {
166 4     4   1798 my ( $ts, $th ) = @_;
167 4         8 my $method = $ts->[0];
168              
169 4         25 return [ $method, "employee/nick", $th->{_JSON} ];
170             }
171              
172             # $METHOD employee nick $NICK
173             sub _method_employee_nick_term {
174 4     4   1800 my ( $ts, $th ) = @_;
175 4         12 my $method = $ts->[0];
176 4         10 my $nick = $th->{_TERM};
177              
178 4         18 return [ $method, "employee/nick/$nick", '' ];
179             }
180              
181             # $METHOD employee nick $NICK ldap
182             sub _method_employee_nick_term_ldap {
183 0     0   0 my ( $ts, $th ) = @_;
184 0         0 my $method = $ts->[0];
185 0         0 my $nick = $th->{_TERM};
186              
187 0         0 return [ $method, "employee/nick/$nick/ldap", '' ];
188             }
189              
190             # $METHOD employee nick $nick $JSON
191             sub _method_employee_nick_term_json {
192 4     4   1841 my ( $ts, $th ) = @_;
193 4         12 my $method = $ts->[0];
194 4         9 my $nick = $th->{_TERM};
195 4         12 my $json = $th->{_JSON};
196              
197 4         27 return [ $method, "employee/nick/$nick", $json ];
198             }
199              
200             # $METHOD employee nick $nick team
201             sub _method_employee_nick_term_team {
202 0     0     my ( $ts, $th ) = @_;
203 0           my $method = $ts->[0];
204 0           my $nick = $th->{_TERM};
205              
206 0           return [ $method, "employee/nick/$nick/team", '' ];
207             }
208              
209             # $METHOD employee search nick $KEY
210             #sub _method_employee_search_nick_key {
211             #}
212              
213             # $METHOD employee team
214             sub _method_employee_team {
215 0     0     my ( $ts, $th ) = @_;
216 0           my $method = $ts->[0];
217              
218 0           return [ $method, "employee/team", '' ];
219             }
220              
221             1;