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.EventRequestParameters;
30 import static org.junit.Assert.*;
33 * The class <code>EventRequestParametersTest</code> contains tests for the class
34 * <code>{@link EventRequestParameters}</code>.
36 * @generatedBy CodePro at 6/1/16 1:41 PM
37 * @version $Revision: 1.0 $
39 public class EventRequestParametersTest {
41 * Run the EventRequestParameters() constructor test.
45 * @generatedBy CodePro at 6/1/16 1:41 PM
48 public void testEventRequestParameters_1() throws Exception {
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() throws Exception {
67 Map<String, String> eventAttributes = new Hashtable<String, String>();
68 UUID requestID = UUID.randomUUID();
70 EventRequestParameters result = new EventRequestParameters(eventAttributes, requestID);
72 // add additional test code here
73 assertNotNull(result);
77 * Run the Map<String, String> getEventAttributes() method test.
81 * @generatedBy CodePro at 6/1/16 1:41 PM
84 public void testGetEventAttributes_1() throws Exception {
85 EventRequestParameters fixture =
86 new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
88 Map<String, String> result = fixture.getEventAttributes();
90 // add additional test code here
91 assertNotNull(result);
92 assertEquals(0, result.size());
96 * Run the UUID getRequestID() method test.
100 * @generatedBy CodePro at 6/1/16 1:41 PM
103 public void testGetRequestID_1() throws Exception {
104 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(),
105 UUID.fromString("5b15376d-569b-4772-ac75-9362043f6a6c"));
107 UUID result = fixture.getRequestID();
109 // add additional test code here
110 assertNotNull(result);
111 assertEquals("5b15376d-569b-4772-ac75-9362043f6a6c", result.toString());
112 assertEquals(4, result.version());
113 assertEquals(2, result.variant());
114 assertEquals(-6019743277723456916L, result.getLeastSignificantBits());
115 assertEquals(6563212974706345842L, result.getMostSignificantBits());
119 * Run the void setEventAttributes(Map<String,String>) method test.
123 * @generatedBy CodePro at 6/1/16 1:41 PM
126 public void testSetEventAttributes_1() throws Exception {
127 EventRequestParameters fixture =
128 new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
129 Map<String, String> eventAttributes = new Hashtable<String, String>();
131 fixture.setEventAttributes(eventAttributes);
133 // add additional test code here
137 * Run the void setRequestID(UUID) method test.
141 * @generatedBy CodePro at 6/1/16 1:41 PM
144 public void testSetRequestID_1() throws Exception {
145 EventRequestParameters fixture =
146 new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
147 UUID requestID = UUID.randomUUID();
149 fixture.setRequestID(requestID);
151 // add additional test code here
155 * Perform pre-test initialization.
157 * @throws Exception if the initialization fails for some reason
159 * @generatedBy CodePro at 6/1/16 1:41 PM
162 public void setUp() throws Exception {
163 // add additional set up code here
167 * Perform post-test clean-up.
169 * @throws Exception if the clean-up fails for some reason
171 * @generatedBy CodePro at 6/1/16 1:41 PM
174 public void tearDown() throws Exception {
175 // Add additional tear down code here
181 * @param args the command line arguments
183 * @generatedBy CodePro at 6/1/16 1:41 PM
185 public static void main(String[] args) {
186 new org.junit.runner.JUnitCore().run(EventRequestParametersTest.class);