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