2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.test;
23 import java.util.Hashtable;
25 import java.util.UUID;
28 import org.onap.policy.api.EventRequestParameters;
30 import static org.junit.Assert.*;
33 * The class <code>EventRequestParametersTest</code> contains tests for the class <code>{@link EventRequestParameters}</code>.
35 * @generatedBy CodePro at 6/1/16 1:41 PM
36 * @version $Revision: 1.0 $
38 public class EventRequestParametersTest {
40 * Run the EventRequestParameters() constructor test.
44 * @generatedBy CodePro at 6/1/16 1:41 PM
47 public void testEventRequestParameters_1()
50 EventRequestParameters result = new EventRequestParameters();
52 // add additional test code here
53 assertNotNull(result);
54 assertEquals(null, result.getEventAttributes());
55 assertEquals(null, result.getRequestID());
59 * Run the EventRequestParameters(Map<String,String>,UUID) constructor test.
63 * @generatedBy CodePro at 6/1/16 1:41 PM
66 public void testEventRequestParameters_2()
68 Map<String, String> eventAttributes = new Hashtable<String, String>();
69 UUID requestID = UUID.randomUUID();
71 EventRequestParameters result = new EventRequestParameters(eventAttributes, requestID);
73 // add additional test code here
74 assertNotNull(result);
78 * Run the Map<String, String> getEventAttributes() method test.
82 * @generatedBy CodePro at 6/1/16 1:41 PM
85 public void testGetEventAttributes_1()
87 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
89 Map<String, String> result = fixture.getEventAttributes();
91 // add additional test code here
92 assertNotNull(result);
93 assertEquals(0, result.size());
97 * Run the UUID getRequestID() method test.
101 * @generatedBy CodePro at 6/1/16 1:41 PM
104 public void testGetRequestID_1()
106 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.fromString("5b15376d-569b-4772-ac75-9362043f6a6c"));
108 UUID result = fixture.getRequestID();
110 // add additional test code here
111 assertNotNull(result);
112 assertEquals("5b15376d-569b-4772-ac75-9362043f6a6c", result.toString());
113 assertEquals(4, result.version());
114 assertEquals(2, result.variant());
115 assertEquals(-6019743277723456916L, result.getLeastSignificantBits());
116 assertEquals(6563212974706345842L, result.getMostSignificantBits());
120 * Run the void setEventAttributes(Map<String,String>) method test.
124 * @generatedBy CodePro at 6/1/16 1:41 PM
127 public void testSetEventAttributes_1()
129 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
130 Map<String, String> eventAttributes = new Hashtable<String, String>();
132 fixture.setEventAttributes(eventAttributes);
134 // add additional test code here
138 * Run the void setRequestID(UUID) method test.
142 * @generatedBy CodePro at 6/1/16 1:41 PM
145 public void testSetRequestID_1()
147 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
148 UUID requestID = UUID.randomUUID();
150 fixture.setRequestID(requestID);
152 // add additional test code here
156 * Perform pre-test initialization.
159 * if the initialization fails for some reason
161 * @generatedBy CodePro at 6/1/16 1:41 PM
166 // add additional set up code here
170 * Perform post-test clean-up.
173 * if the clean-up fails for some reason
175 * @generatedBy CodePro at 6/1/16 1:41 PM
178 public void tearDown()
180 // Add additional tear down code here
186 * @param args the command line arguments
188 * @generatedBy CodePro at 6/1/16 1:41 PM
190 public static void main(String[] args) {
191 new org.junit.runner.JUnitCore().run(EventRequestParametersTest.class);