2 * ============LICENSE_START=======================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
23 package org.onap.policy.test;
25 import java.util.Hashtable;
27 import java.util.UUID;
29 import org.onap.policy.api.DecisionRequestParameters;
30 import static org.junit.Assert.*;
33 * The class <code>DecisionRequestParametersTest</code> contains tests for the class
34 * <code>{@link DecisionRequestParameters}</code>.
36 * @generatedBy CodePro at 6/1/16 1:41 PM
37 * @version $Revision: 1.0 $
39 public class DecisionRequestParametersTest {
41 * Run the DecisionRequestParameters() constructor test.
45 * @generatedBy CodePro at 6/1/16 1:41 PM
48 public void testDecisionRequestParameters_1() throws Exception {
50 DecisionRequestParameters result = new DecisionRequestParameters();
52 // add additional test code here
53 assertNotNull(result);
54 assertEquals(null, result.getOnapName());
55 assertEquals(null, result.getDecisionAttributes());
56 assertEquals(null, result.getRequestID());
60 * Run the DecisionRequestParameters(String,Map<String,String>,UUID) constructor test.
64 * @generatedBy CodePro at 6/1/16 1:41 PM
67 public void testDecisionRequestParameters_2() throws Exception {
68 String onapComponentName = "";
69 Map<String, String> decisionAttributes = new Hashtable<String, String>();
70 UUID requestID = UUID.randomUUID();
72 DecisionRequestParameters result =
73 new DecisionRequestParameters(onapComponentName, decisionAttributes, requestID);
75 // add additional test code here
76 assertNotNull(result);
77 assertEquals("", result.getOnapName());
81 * Run the Map<String, String> getDecisionAttributes() method test.
85 * @generatedBy CodePro at 6/1/16 1:41 PM
88 public void testGetDecisionAttributes_1() throws Exception {
89 DecisionRequestParameters fixture = new DecisionRequestParameters("",
90 new Hashtable<String, String>(), UUID.randomUUID());
92 Map<String, String> result = fixture.getDecisionAttributes();
94 // add additional test code here
95 assertNotNull(result);
96 assertEquals(0, result.size());
100 * Run the String getONAPComponentName() method test.
104 * @generatedBy CodePro at 6/1/16 1:41 PM
107 public void testGetONAPComponentName_1() throws Exception {
108 DecisionRequestParameters fixture = new DecisionRequestParameters("",
109 new Hashtable<String, String>(), UUID.randomUUID());
111 String result = fixture.getOnapName();
113 // add additional test code here
114 assertEquals("", result);
118 * Run the UUID getRequestID() method test.
122 * @generatedBy CodePro at 6/1/16 1:41 PM
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"));
130 UUID result = fixture.getRequestID();
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());
142 * Run the void setDecisionAttributes(Map<String,String>) method test.
146 * @generatedBy CodePro at 6/1/16 1:41 PM
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>();
154 fixture.setDecisionAttributes(decisionAttributes);
156 // add additional test code here
160 * Run the void setONAPComponentName(String) method test.
164 * @generatedBy CodePro at 6/1/16 1:41 PM
167 public void testSetONAPComponentName_1() throws Exception {
168 DecisionRequestParameters fixture = new DecisionRequestParameters("",
169 new Hashtable<String, String>(), UUID.randomUUID());
170 String onapComponentName = "";
172 fixture.setOnapName(onapComponentName);
174 // add additional test code here
178 * Run the void setRequestID(UUID) method test.
182 * @generatedBy CodePro at 6/1/16 1:41 PM
185 public void testSetRequestID_1() throws Exception {
186 DecisionRequestParameters fixture = new DecisionRequestParameters("",
187 new Hashtable<String, String>(), UUID.randomUUID());
188 UUID requestID = UUID.randomUUID();
190 fixture.setRequestID(requestID);
192 // add additional test code here
196 * Perform pre-test initialization.
198 * @throws Exception if the initialization fails for some reason
200 * @generatedBy CodePro at 6/1/16 1:41 PM
203 public void setUp() throws Exception {
204 // add additional set up code here
208 * Perform post-test clean-up.
210 * @throws Exception if the clean-up fails for some reason
212 * @generatedBy CodePro at 6/1/16 1:41 PM
215 public void tearDown() throws Exception {
216 // Add additional tear down code here
222 * @param args the command line arguments
224 * @generatedBy CodePro at 6/1/16 1:41 PM
226 public static void main(String[] args) {
227 new org.junit.runner.JUnitCore().run(DecisionRequestParametersTest.class);