File Coverage

blib/lib/App/Dochazka/CLI/Commands/RestTest/Employee.pm
Criterion Covered Total %
statement 66 88 75.0
branch n/a
condition n/a
subroutine 20 26 76.9
pod n/a
total 86 114 75.4


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   246 use 5.012;
  20         38  
35 20     20   124 use strict;
  20         21  
  20         285  
36 20     20   56 use warnings;
  20         24  
  20         13508  
37              
38             # $METHOD employee
39             sub _method_employee {
40 8     8   3007 my ( $ts, $th ) = @_;
41 8         15 my $method = $ts->[0];
42              
43 8         38 return [ $method, "employee", $th->{_REST} ];
44             }
45              
46             # $METHOD employee count
47             sub _method_employee_count {
48 8     8   3069 my ( $ts, $th ) = @_;
49 8         20 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   3001 my ( $ts, $th ) = @_;
57 8         16 my $method = $ts->[0];
58              
59 8         36 return [ $method, "employee/count/priv", $th->{_REST} ];
60             }
61              
62             # $METHOD employee current
63             sub _method_employee_current {
64 8     8   2887 my ( $ts, $th ) = @_;
65 8         17 my $method = $ts->[0];
66              
67 8         35 return [ $method, "employee/current", $th->{_REST} ];
68             }
69              
70             # $METHOD employee current priv
71             sub _method_employee_current_priv {
72 8     8   2947 my ( $ts, $th ) = @_;
73 8         15 my $method = $ts->[0];
74              
75 8         39 return [ $method, "employee/current/priv", $th->{_REST} ];
76             }
77              
78             # $METHOD employee search
79             sub _method_employee_search {
80 8     8   2905 my ( $ts, $th ) = @_;
81 8         17 my $method = $ts->[0];
82              
83 8         38 return [ $method, "employee/search", $th->{_REST} ];
84             }
85              
86             # $METHOD employee search nick _TERM
87             sub _method_employee_search_nick {
88 8     8   3041 my ( $ts, $th ) = @_;
89 8         15 my $method = $ts->[0];
90 8         14 my $nick = $th->{_TERM};
91              
92 8         40 return [ $method, "employee/search/nick/$nick", $th->{_REST} ];
93             }
94              
95             # $METHOD employee self
96             sub _method_employee_self {
97 8     8   2874 my ( $ts, $th ) = @_;
98 8         14 my $method = $ts->[0];
99              
100 8         36 return [ $method, "employee/self", $th->{_REST} ];
101             }
102              
103             # $METHOD employee self priv
104             sub _method_employee_self_priv {
105 8     8   2925 my ( $ts, $th ) = @_;
106 8         15 my $method = $ts->[0];
107              
108 8         37 return [ $method, "employee/self/priv", $th->{_REST} ];
109             }
110              
111             # $METHOD employee eid
112             sub _method_employee_eid {
113 4     4   1436 my ( $ts, $th ) = @_;
114 4         10 my $method = $ts->[0];
115              
116 4         12 return [ $method, "employee/eid", '' ];
117             }
118              
119             # $METHOD employee eid $JSON
120             sub _method_employee_eid_json {
121 4     4   1495 my ( $ts, $th ) = @_;
122 4         8 my $method = $ts->[0];
123              
124 4         24 return [ $method, "employee/eid", $th->{_JSON} ];
125             }
126              
127             # $METHOD employee eid $EID
128             sub _method_employee_eid_num {
129 4     4   1455 my ( $ts, $th ) = @_;
130 4         5 my $method = $ts->[0];
131 4         7 my $eid = $th->{_NUM};
132              
133 4         15 return [ $method, "employee/eid/$eid", '' ];
134             }
135              
136             # $METHOD employee eid $EID $JSON
137             sub _method_employee_eid_num_json {
138 4     4   1459 my ( $ts, $th ) = @_;
139 4         5 my $method = $ts->[0];
140 4         8 my $eid = $th->{_NUM};
141 4         4 my $json = $th->{_JSON};
142              
143 4         23 return [ $method, "employee/eid/$eid", $json ];
144             }
145              
146             # $METHOD employee eid $EID team
147             sub _method_employee_eid_num_team {
148 0     0   0 my ( $ts, $th ) = @_;
149 0         0 my $method = $ts->[0];
150 0         0 my $eid = $th->{_NUM};
151              
152 0         0 return [ $method, "employee/eid/$eid/team", '' ];
153             }
154              
155             # $METHOD employee list
156             sub _method_employee_list {
157 0     0   0 my ( $ts, $th ) = @_;
158 0         0 my $method = $ts->[0];
159              
160 0         0 return [ $method, "employee/list", '' ];
161             }
162              
163             # $METHOD employee list $PRIV
164             sub _method_employee_list_priv {
165 0     0   0 my ( $ts, $th ) = @_;
166 0         0 my $method = $ts->[0];
167 0         0 my $priv = $th->{_TERM};
168              
169 0         0 return [ $method, "employee/list/$priv", '' ];
170             }
171              
172             # $METHOD employee nick
173             sub _method_employee_nick {
174 4     4   1464 my ( $ts, $th ) = @_;
175 4         8 my $method = $ts->[0];
176              
177 4         13 return [ $method, "employee/nick", '' ];
178             }
179              
180             # $METHOD employee nick $JSON
181             sub _method_employee_nick_json {
182 4     4   1472 my ( $ts, $th ) = @_;
183 4         9 my $method = $ts->[0];
184              
185 4         23 return [ $method, "employee/nick", $th->{_JSON} ];
186             }
187              
188             # $METHOD employee nick $NICK
189             sub _method_employee_nick_term {
190 4     4   1489 my ( $ts, $th ) = @_;
191 4         7 my $method = $ts->[0];
192 4         8 my $nick = $th->{_TERM};
193              
194 4         15 return [ $method, "employee/nick/$nick", '' ];
195             }
196              
197             # $METHOD employee nick $NICK ldap
198             sub _method_employee_nick_term_ldap {
199 0     0   0 my ( $ts, $th ) = @_;
200 0         0 my $method = $ts->[0];
201 0         0 my $nick = $th->{_TERM};
202              
203 0         0 return [ $method, "employee/nick/$nick/ldap", '' ];
204             }
205              
206             # $METHOD employee nick $nick $JSON
207             sub _method_employee_nick_term_json {
208 4     4   1478 my ( $ts, $th ) = @_;
209 4         6 my $method = $ts->[0];
210 4         5 my $nick = $th->{_TERM};
211 4         5 my $json = $th->{_JSON};
212              
213 4         23 return [ $method, "employee/nick/$nick", $json ];
214             }
215              
216             # $METHOD employee nick $nick team
217             sub _method_employee_nick_term_team {
218 0     0     my ( $ts, $th ) = @_;
219 0           my $method = $ts->[0];
220 0           my $nick = $th->{_TERM};
221              
222 0           return [ $method, "employee/nick/$nick/team", '' ];
223             }
224              
225             # $METHOD employee search nick $KEY
226             #sub _method_employee_search_nick_key {
227             #}
228              
229             # $METHOD employee team
230             sub _method_employee_team {
231 0     0     my ( $ts, $th ) = @_;
232 0           my $method = $ts->[0];
233              
234 0           return [ $method, "employee/team", '' ];
235             }
236              
237             1;