4fecea8c290478ae8d7d7b73c5f6090667fd5a51
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / test / EventRequestParametersTest.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.EventRequestParameters;
29
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>EventRequestParametersTest</code> contains tests for the class <code>{@link EventRequestParameters}</code>.
34  *
35  * @generatedBy CodePro at 6/1/16 1:41 PM
36  * @version $Revision: 1.0 $
37  */
38 public class EventRequestParametersTest {
39         /**
40          * Run the EventRequestParameters() constructor test.
41          *
42          * @throws Exception
43          *
44          * @generatedBy CodePro at 6/1/16 1:41 PM
45          */
46         @Test
47         public void testEventRequestParameters_1()
48                 throws Exception {
49
50                 EventRequestParameters result = new EventRequestParameters();
51
52                 // add additional test code here
53                 assertNotNull(result);
54                 assertEquals(null, result.getEventAttributes());
55                 assertEquals(null, result.getRequestID());
56         }
57
58         /**
59          * Run the EventRequestParameters(Map<String,String>,UUID) constructor test.
60          *
61          * @throws Exception
62          *
63          * @generatedBy CodePro at 6/1/16 1:41 PM
64          */
65         @Test
66         public void testEventRequestParameters_2()
67                 throws Exception {
68                 Map<String, String> eventAttributes = new Hashtable<String, String>();
69                 UUID requestID = UUID.randomUUID();
70
71                 EventRequestParameters result = new EventRequestParameters(eventAttributes, requestID);
72
73                 // add additional test code here
74                 assertNotNull(result);
75         }
76
77         /**
78          * Run the Map<String, String> getEventAttributes() method test.
79          *
80          * @throws Exception
81          *
82          * @generatedBy CodePro at 6/1/16 1:41 PM
83          */
84         @Test
85         public void testGetEventAttributes_1()
86                 throws Exception {
87                 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
88
89                 Map<String, String> result = fixture.getEventAttributes();
90
91                 // add additional test code here
92                 assertNotNull(result);
93                 assertEquals(0, result.size());
94         }
95
96         /**
97          * Run the UUID getRequestID() method test.
98          *
99          * @throws Exception
100          *
101          * @generatedBy CodePro at 6/1/16 1:41 PM
102          */
103         @Test
104         public void testGetRequestID_1()
105                 throws Exception {
106                 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.fromString("5b15376d-569b-4772-ac75-9362043f6a6c"));
107
108                 UUID result = fixture.getRequestID();
109
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());
117         }
118
119         /**
120          * Run the void setEventAttributes(Map<String,String>) method test.
121          *
122          * @throws Exception
123          *
124          * @generatedBy CodePro at 6/1/16 1:41 PM
125          */
126         @Test
127         public void testSetEventAttributes_1()
128                 throws Exception {
129                 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
130                 Map<String, String> eventAttributes = new Hashtable<String, String>();
131
132                 fixture.setEventAttributes(eventAttributes);
133
134                 // add additional test code here
135         }
136
137         /**
138          * Run the void setRequestID(UUID) method test.
139          *
140          * @throws Exception
141          *
142          * @generatedBy CodePro at 6/1/16 1:41 PM
143          */
144         @Test
145         public void testSetRequestID_1()
146                 throws Exception {
147                 EventRequestParameters fixture = new EventRequestParameters(new Hashtable<String, String>(), UUID.randomUUID());
148                 UUID requestID = UUID.randomUUID();
149
150                 fixture.setRequestID(requestID);
151
152                 // add additional test code here
153         }
154
155         /**
156          * Perform pre-test initialization.
157          *
158          * @throws Exception
159          *         if the initialization fails for some reason
160          *
161          * @generatedBy CodePro at 6/1/16 1:41 PM
162          */
163         @Before
164         public void setUp()
165                 throws Exception {
166                 // add additional set up code here
167         }
168
169         /**
170          * Perform post-test clean-up.
171          *
172          * @throws Exception
173          *         if the clean-up fails for some reason
174          *
175          * @generatedBy CodePro at 6/1/16 1:41 PM
176          */
177         @After
178         public void tearDown()
179                 throws Exception {
180                 // Add additional tear down code here
181         }
182
183         /**
184          * Launch the test.
185          *
186          * @param args the command line arguments
187          *
188          * @generatedBy CodePro at 6/1/16 1:41 PM
189          */
190         public static void main(String[] args) {
191                 new org.junit.runner.JUnitCore().run(EventRequestParametersTest.class);
192         }
193 }