11179aecec5f39090fbb05c34d7ff0902e22c33e
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / std / test / StdPolicyResponseTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * PolicyEngineAPI
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.std.test;
22
23 import java.util.Hashtable;
24 import java.util.Map;
25
26 import org.junit.*;
27 import org.onap.policy.api.PolicyResponseStatus;
28 import org.onap.policy.std.StdPolicyResponse;
29
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>StdPolicyResponseTest</code> contains tests for the class <code>{@link StdPolicyResponse}</code>.
34  *
35  * @generatedBy CodePro at 6/1/16 1:40 PM
36  * @version $Revision: 1.0 $
37  */
38 public class StdPolicyResponseTest {
39         /**
40          * Run the Map<String, String> getActionAdvised() method test.
41          *
42          * @throws Exception
43          *
44          * @generatedBy CodePro at 6/1/16 1:40 PM
45          */
46         @Test
47         public void testGetActionAdvised_1()
48                 throws Exception {
49                 StdPolicyResponse fixture = new StdPolicyResponse();
50                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
51                 fixture.setRequestAttributes(new Hashtable<String, String>());
52                 fixture.setActionAdvised(new Hashtable<String, String>());
53                 fixture.setActionTaken(new Hashtable<String, String>());
54
55                 Map<String, String> result = fixture.getActionAdvised();
56
57                 // add additional test code here
58                 assertNotNull(result);
59                 assertEquals(0, result.size());
60         }
61
62         /**
63          * Run the Map<String, String> getActionTaken() method test.
64          *
65          * @throws Exception
66          *
67          * @generatedBy CodePro at 6/1/16 1:40 PM
68          */
69         @Test
70         public void testGetActionTaken_1()
71                 throws Exception {
72                 StdPolicyResponse fixture = new StdPolicyResponse();
73                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
74                 fixture.setRequestAttributes(new Hashtable<String, String>());
75                 fixture.setActionAdvised(new Hashtable<String, String>());
76                 fixture.setActionTaken(new Hashtable<String, String>());
77
78                 Map<String, String> result = fixture.getActionTaken();
79
80                 // add additional test code here
81                 assertNotNull(result);
82                 assertEquals(0, result.size());
83         }
84
85         /**
86          * Run the String getPolicyResponseMessage() method test.
87          *
88          * @throws Exception
89          *
90          * @generatedBy CodePro at 6/1/16 1:40 PM
91          */
92         @Test
93         public void testGetPolicyResponseMessage_1()
94                 throws Exception {
95                 StdPolicyResponse fixture = new StdPolicyResponse();
96                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
97                 fixture.setRequestAttributes(new Hashtable<String, String>());
98                 fixture.setActionAdvised(new Hashtable<String, String>());
99                 fixture.setActionTaken(new Hashtable<String, String>());
100
101                 String result = fixture.getPolicyResponseMessage();
102
103                 // add additional test code here
104                 assertEquals("", result);
105         }
106
107         /**
108          * Run the PolicyResponseStatus getPolicyResponseStatus() method test.
109          *
110          * @throws Exception
111          *
112          * @generatedBy CodePro at 6/1/16 1:40 PM
113          */
114         @Test
115         public void testGetPolicyResponseStatus_1()
116                 throws Exception {
117                 StdPolicyResponse fixture = new StdPolicyResponse();
118                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
119                 fixture.setRequestAttributes(new Hashtable<String, String>());
120                 fixture.setActionAdvised(new Hashtable<String, String>());
121                 fixture.setActionTaken(new Hashtable<String, String>());
122
123                 PolicyResponseStatus result = fixture.getPolicyResponseStatus();
124
125                 // add additional test code here
126                 assertNotNull(result);
127                 assertEquals("action_advised", result.toString());
128                 assertEquals("ACTION_ADVISED", result.name());
129                 assertEquals(1, result.ordinal());
130         }
131
132         /**
133          * Run the Map<String, String> getRequestAttributes() method test.
134          *
135          * @throws Exception
136          *
137          * @generatedBy CodePro at 6/1/16 1:40 PM
138          */
139         @Test
140         public void testGetRequestAttributes_1()
141                 throws Exception {
142                 StdPolicyResponse fixture = new StdPolicyResponse();
143                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
144                 fixture.setRequestAttributes(new Hashtable<String, String>());
145                 fixture.setActionAdvised(new Hashtable<String, String>());
146                 fixture.setActionTaken(new Hashtable<String, String>());
147
148                 Map<String, String> result = fixture.getRequestAttributes();
149
150                 // add additional test code here
151                 assertNotNull(result);
152                 assertEquals(0, result.size());
153         }
154
155         /**
156          * Run the void setActionAdvised(Map<String,String>) method test.
157          *
158          * @throws Exception
159          *
160          * @generatedBy CodePro at 6/1/16 1:40 PM
161          */
162         @Test
163         public void testSetActionAdvised_1()
164                 throws Exception {
165                 StdPolicyResponse fixture = new StdPolicyResponse();
166                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
167                 fixture.setRequestAttributes(new Hashtable<String, String>());
168                 fixture.setActionAdvised(new Hashtable<String, String>());
169                 fixture.setActionTaken(new Hashtable<String, String>());
170                 Map<String, String> actionAdvised = new Hashtable<String, String>();
171
172                 fixture.setActionAdvised(actionAdvised);
173
174                 // add additional test code here
175         }
176
177         /**
178          * Run the void setActionTaken(Map<String,String>) method test.
179          *
180          * @throws Exception
181          *
182          * @generatedBy CodePro at 6/1/16 1:40 PM
183          */
184         @Test
185         public void testSetActionTaken_1()
186                 throws Exception {
187                 StdPolicyResponse fixture = new StdPolicyResponse();
188                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
189                 fixture.setRequestAttributes(new Hashtable<String, String>());
190                 fixture.setActionAdvised(new Hashtable<String, String>());
191                 fixture.setActionTaken(new Hashtable<String, String>());
192                 Map<String, String> actionTaken = new Hashtable<String, String>();
193
194                 fixture.setActionTaken(actionTaken);
195
196                 // add additional test code here
197         }
198
199         /**
200          * Run the void setPolicyResponseMessage(String) method test.
201          *
202          * @throws Exception
203          *
204          * @generatedBy CodePro at 6/1/16 1:40 PM
205          */
206         @Test
207         public void testSetPolicyResponseMessage_1()
208                 throws Exception {
209                 StdPolicyResponse fixture = new StdPolicyResponse();
210                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
211                 fixture.setRequestAttributes(new Hashtable<String, String>());
212                 fixture.setActionAdvised(new Hashtable<String, String>());
213                 fixture.setActionTaken(new Hashtable<String, String>());
214                 String policyResponseMessage = "";
215
216                 fixture.setPolicyResponseMessage(policyResponseMessage);
217
218                 // add additional test code here
219         }
220
221         /**
222          * Run the void setPolicyResponseStatus(PolicyResponseStatus) method test.
223          *
224          * @throws Exception
225          *
226          * @generatedBy CodePro at 6/1/16 1:40 PM
227          */
228         @Test
229         public void testSetPolicyResponseStatus_1()
230                 throws Exception {
231                 StdPolicyResponse fixture = new StdPolicyResponse();
232                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
233                 fixture.setRequestAttributes(new Hashtable<String, String>());
234                 fixture.setActionAdvised(new Hashtable<String, String>());
235                 fixture.setActionTaken(new Hashtable<String, String>());
236                 PolicyResponseStatus policyResponseStatus = PolicyResponseStatus.ACTION_ADVISED;
237
238                 fixture.setPolicyResponseStatus(policyResponseStatus);
239
240                 // add additional test code here
241         }
242
243         /**
244          * Run the void setPolicyResponseStatus(String,PolicyResponseStatus) method test.
245          *
246          * @throws Exception
247          *
248          * @generatedBy CodePro at 6/1/16 1:40 PM
249          */
250         @Test
251         public void testSetPolicyResponseStatus_2()
252                 throws Exception {
253                 StdPolicyResponse fixture = new StdPolicyResponse();
254                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
255                 fixture.setRequestAttributes(new Hashtable<String, String>());
256                 fixture.setActionAdvised(new Hashtable<String, String>());
257                 fixture.setActionTaken(new Hashtable<String, String>());
258                 String policyResponseMessage = "";
259                 PolicyResponseStatus policyResponseStatus = PolicyResponseStatus.ACTION_ADVISED;
260
261                 fixture.setPolicyResponseStatus(policyResponseMessage, policyResponseStatus);
262
263                 // add additional test code here
264         }
265
266         /**
267          * Run the void setRequestAttributes(Map<String,String>) method test.
268          *
269          * @throws Exception
270          *
271          * @generatedBy CodePro at 6/1/16 1:40 PM
272          */
273         @Test
274         public void testSetRequestAttributes_1()
275                 throws Exception {
276                 StdPolicyResponse fixture = new StdPolicyResponse();
277                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
278                 fixture.setRequestAttributes(new Hashtable<String, String>());
279                 fixture.setActionAdvised(new Hashtable<String, String>());
280                 fixture.setActionTaken(new Hashtable<String, String>());
281                 Map<String, String> requestAttributes = new Hashtable<String, String>();
282
283                 fixture.setRequestAttributes(requestAttributes);
284
285                 // add additional test code here
286         }
287
288         /**
289          * Run the String toString() method test.
290          *
291          * @throws Exception
292          *
293          * @generatedBy CodePro at 6/1/16 1:40 PM
294          */
295         @Test
296         public void testToString_1()
297                 throws Exception {
298                 StdPolicyResponse fixture = new StdPolicyResponse();
299                 fixture.setPolicyResponseStatus("", PolicyResponseStatus.ACTION_ADVISED);
300                 fixture.setRequestAttributes(new Hashtable<String, String>());
301                 fixture.setActionAdvised(new Hashtable<String, String>());
302                 fixture.setActionTaken(new Hashtable<String, String>());
303
304                 String result = fixture.toString();
305
306                 // add additional test code here
307                 assertEquals("PolicyResponse [ policyResponseStatus=action_advised, policyResponseMessage=, ]", result);
308         }
309
310         /**
311          * Perform pre-test initialization.
312          *
313          * @throws Exception
314          *         if the initialization fails for some reason
315          *
316          * @generatedBy CodePro at 6/1/16 1:40 PM
317          */
318         @Before
319         public void setUp()
320                 throws Exception {
321                 // add additional set up code here
322         }
323
324         /**
325          * Perform post-test clean-up.
326          *
327          * @throws Exception
328          *         if the clean-up fails for some reason
329          *
330          * @generatedBy CodePro at 6/1/16 1:40 PM
331          */
332         @After
333         public void tearDown()
334                 throws Exception {
335                 // Add additional tear down code here
336         }
337
338         /**
339          * Launch the test.
340          *
341          * @param args the command line arguments
342          *
343          * @generatedBy CodePro at 6/1/16 1:40 PM
344          */
345         public static void main(String[] args) {
346                 new org.junit.runner.JUnitCore().run(StdPolicyResponseTest.class);
347         }
348 }