Reformat PolicyEngineAPI test cases
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / test / DecisionRequestParametersTest.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.test;
24
25 import java.util.Hashtable;
26 import java.util.Map;
27 import java.util.UUID;
28 import org.junit.*;
29 import org.onap.policy.api.DecisionRequestParameters;
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>DecisionRequestParametersTest</code> contains tests for the class
34  * <code>{@link DecisionRequestParameters}</code>.
35  *
36  * @generatedBy CodePro at 6/1/16 1:41 PM
37  * @version $Revision: 1.0 $
38  */
39 public class DecisionRequestParametersTest {
40     /**
41      * Run the DecisionRequestParameters() constructor test.
42      *
43      * @throws Exception
44      *
45      * @generatedBy CodePro at 6/1/16 1:41 PM
46      */
47     @Test
48     public void testDecisionRequestParameters_1() throws Exception {
49
50         DecisionRequestParameters result = new DecisionRequestParameters();
51
52         // add additional test code here
53         assertNotNull(result);
54         assertEquals(null, result.getOnapName());
55         assertEquals(null, result.getDecisionAttributes());
56         assertEquals(null, result.getRequestID());
57     }
58
59     /**
60      * Run the DecisionRequestParameters(String,Map<String,String>,UUID) constructor test.
61      *
62      * @throws Exception
63      *
64      * @generatedBy CodePro at 6/1/16 1:41 PM
65      */
66     @Test
67     public void testDecisionRequestParameters_2() throws Exception {
68         String onapComponentName = "";
69         Map<String, String> decisionAttributes = new Hashtable<String, String>();
70         UUID requestID = UUID.randomUUID();
71
72         DecisionRequestParameters result =
73                 new DecisionRequestParameters(onapComponentName, decisionAttributes, requestID);
74
75         // add additional test code here
76         assertNotNull(result);
77         assertEquals("", result.getOnapName());
78     }
79
80     /**
81      * Run the Map<String, String> getDecisionAttributes() method test.
82      *
83      * @throws Exception
84      *
85      * @generatedBy CodePro at 6/1/16 1:41 PM
86      */
87     @Test
88     public void testGetDecisionAttributes_1() throws Exception {
89         DecisionRequestParameters fixture = new DecisionRequestParameters("",
90                 new Hashtable<String, String>(), UUID.randomUUID());
91
92         Map<String, String> result = fixture.getDecisionAttributes();
93
94         // add additional test code here
95         assertNotNull(result);
96         assertEquals(0, result.size());
97     }
98
99     /**
100      * Run the String getONAPComponentName() method test.
101      *
102      * @throws Exception
103      *
104      * @generatedBy CodePro at 6/1/16 1:41 PM
105      */
106     @Test
107     public void testGetONAPComponentName_1() throws Exception {
108         DecisionRequestParameters fixture = new DecisionRequestParameters("",
109                 new Hashtable<String, String>(), UUID.randomUUID());
110
111         String result = fixture.getOnapName();
112
113         // add additional test code here
114         assertEquals("", result);
115     }
116
117     /**
118      * Run the UUID getRequestID() method test.
119      *
120      * @throws Exception
121      *
122      * @generatedBy CodePro at 6/1/16 1:41 PM
123      */
124     @Test
125     public void testGetRequestID_1() throws Exception {
126         DecisionRequestParameters fixture =
127                 new DecisionRequestParameters("", new Hashtable<String, String>(),
128                         UUID.fromString("d1db6a6d-7140-4864-8200-6b541261fdd2"));
129
130         UUID result = fixture.getRequestID();
131
132         // add additional test code here
133         assertNotNull(result);
134         assertEquals("d1db6a6d-7140-4864-8200-6b541261fdd2", result.toString());
135         assertEquals(4, result.version());
136         assertEquals(2, result.variant());
137         assertEquals(-9079138839949083182L, result.getLeastSignificantBits());
138         assertEquals(-3324946881598961564L, result.getMostSignificantBits());
139     }
140
141     /**
142      * Run the void setDecisionAttributes(Map<String,String>) method test.
143      *
144      * @throws Exception
145      *
146      * @generatedBy CodePro at 6/1/16 1:41 PM
147      */
148     @Test
149     public void testSetDecisionAttributes_1() throws Exception {
150         DecisionRequestParameters fixture = new DecisionRequestParameters("",
151                 new Hashtable<String, String>(), UUID.randomUUID());
152         Map<String, String> decisionAttributes = new Hashtable<String, String>();
153
154         fixture.setDecisionAttributes(decisionAttributes);
155
156         // add additional test code here
157     }
158
159     /**
160      * Run the void setONAPComponentName(String) method test.
161      *
162      * @throws Exception
163      *
164      * @generatedBy CodePro at 6/1/16 1:41 PM
165      */
166     @Test
167     public void testSetONAPComponentName_1() throws Exception {
168         DecisionRequestParameters fixture = new DecisionRequestParameters("",
169                 new Hashtable<String, String>(), UUID.randomUUID());
170         String onapComponentName = "";
171
172         fixture.setOnapName(onapComponentName);
173
174         // add additional test code here
175     }
176
177     /**
178      * Run the void setRequestID(UUID) method test.
179      *
180      * @throws Exception
181      *
182      * @generatedBy CodePro at 6/1/16 1:41 PM
183      */
184     @Test
185     public void testSetRequestID_1() throws Exception {
186         DecisionRequestParameters fixture = new DecisionRequestParameters("",
187                 new Hashtable<String, String>(), UUID.randomUUID());
188         UUID requestID = UUID.randomUUID();
189
190         fixture.setRequestID(requestID);
191
192         // add additional test code here
193     }
194
195     /**
196      * Perform pre-test initialization.
197      *
198      * @throws Exception if the initialization fails for some reason
199      *
200      * @generatedBy CodePro at 6/1/16 1:41 PM
201      */
202     @Before
203     public void setUp() throws Exception {
204         // add additional set up code here
205     }
206
207     /**
208      * Perform post-test clean-up.
209      *
210      * @throws Exception if the clean-up fails for some reason
211      *
212      * @generatedBy CodePro at 6/1/16 1:41 PM
213      */
214     @After
215     public void tearDown() throws Exception {
216         // Add additional tear down code here
217     }
218
219     /**
220      * Launch the test.
221      *
222      * @param args the command line arguments
223      *
224      * @generatedBy CodePro at 6/1/16 1:41 PM
225      */
226     public static void main(String[] args) {
227         new org.junit.runner.JUnitCore().run(DecisionRequestParametersTest.class);
228     }
229 }