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