a29bb13149a41ddf319da767ce7eb853cba9f721
[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  * 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.test;
22
23 import java.util.Hashtable;
24 import java.util.Map;
25 import java.util.UUID;
26
27 import org.junit.*;
28 import org.onap.policy.api.DecisionRequestParameters;
29
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>DecisionRequestParametersTest</code> contains tests for the class <code>{@link DecisionRequestParameters}</code>.
34  *
35  * @generatedBy CodePro at 6/1/16 1:41 PM
36  * @version $Revision: 1.0 $
37  */
38 public class DecisionRequestParametersTest {
39         /**
40          * Run the DecisionRequestParameters() constructor test.
41          *
42          * @throws Exception
43          *
44          * @generatedBy CodePro at 6/1/16 1:41 PM
45          */
46         @Test
47         public void testDecisionRequestParameters_1()
48                 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()
68                 throws Exception {
69                 String onapComponentName = "";
70                 Map<String, String> decisionAttributes = new Hashtable<String, String>();
71                 UUID requestID = UUID.randomUUID();
72
73                 DecisionRequestParameters result = 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()
89                 throws Exception {
90                 DecisionRequestParameters fixture = new DecisionRequestParameters("", 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()
108                 throws Exception {
109                 DecisionRequestParameters fixture = new DecisionRequestParameters("", 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()
126                 throws Exception {
127                 DecisionRequestParameters fixture = new DecisionRequestParameters("", new Hashtable<String, String>(), UUID.fromString("d1db6a6d-7140-4864-8200-6b541261fdd2"));
128
129                 UUID result = fixture.getRequestID();
130
131                 // add additional test code here
132                 assertNotNull(result);
133                 assertEquals("d1db6a6d-7140-4864-8200-6b541261fdd2", result.toString());
134                 assertEquals(4, result.version());
135                 assertEquals(2, result.variant());
136                 assertEquals(-9079138839949083182L, result.getLeastSignificantBits());
137                 assertEquals(-3324946881598961564L, result.getMostSignificantBits());
138         }
139
140         /**
141          * Run the void setDecisionAttributes(Map<String,String>) method test.
142          *
143          * @throws Exception
144          *
145          * @generatedBy CodePro at 6/1/16 1:41 PM
146          */
147         @Test
148         public void testSetDecisionAttributes_1()
149                 throws Exception {
150                 DecisionRequestParameters fixture = new DecisionRequestParameters("", new Hashtable<String, String>(), UUID.randomUUID());
151                 Map<String, String> decisionAttributes = new Hashtable<String, String>();
152
153                 fixture.setDecisionAttributes(decisionAttributes);
154
155                 // add additional test code here
156         }
157
158         /**
159          * Run the void setONAPComponentName(String) method test.
160          *
161          * @throws Exception
162          *
163          * @generatedBy CodePro at 6/1/16 1:41 PM
164          */
165         @Test
166         public void testSetONAPComponentName_1()
167                 throws Exception {
168                 DecisionRequestParameters fixture = new DecisionRequestParameters("", new Hashtable<String, String>(), UUID.randomUUID());
169                 String onapComponentName = "";
170
171                 fixture.setOnapName(onapComponentName);
172
173                 // add additional test code here
174         }
175
176         /**
177          * Run the void setRequestID(UUID) method test.
178          *
179          * @throws Exception
180          *
181          * @generatedBy CodePro at 6/1/16 1:41 PM
182          */
183         @Test
184         public void testSetRequestID_1()
185                 throws Exception {
186                 DecisionRequestParameters fixture = new DecisionRequestParameters("", new Hashtable<String, String>(), UUID.randomUUID());
187                 UUID requestID = UUID.randomUUID();
188
189                 fixture.setRequestID(requestID);
190
191                 // add additional test code here
192         }
193
194         /**
195          * Perform pre-test initialization.
196          *
197          * @throws Exception
198          *         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()
204                 throws Exception {
205                 // add additional set up code here
206         }
207
208         /**
209          * Perform post-test clean-up.
210          *
211          * @throws Exception
212          *         if the clean-up fails for some reason
213          *
214          * @generatedBy CodePro at 6/1/16 1:41 PM
215          */
216         @After
217         public void tearDown()
218                 throws Exception {
219                 // Add additional tear down code here
220         }
221
222         /**
223          * Launch the test.
224          *
225          * @param args the command line arguments
226          *
227          * @generatedBy CodePro at 6/1/16 1:41 PM
228          */
229         public static void main(String[] args) {
230                 new org.junit.runner.JUnitCore().run(DecisionRequestParametersTest.class);
231         }
232 }