Merge "Reorder modifiers"
[so.git] / adapters / mso-adapters-rest-interface / src / test / java / org / openecomp / mso / adapters / sdncrest / SDNCEventTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2018 TechMahindra
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.openecomp.mso.adapters.sdncrest;
22
23 import static org.junit.Assert.*;
24
25 import org.junit.Assert;
26 import org.junit.Before;
27 import org.junit.Test;
28
29 import java.util.HashMap;
30 import java.util.Map;
31
32 public class SDNCEventTest {
33
34     private SDNCEvent sdncEvent;
35     private Map<String, String> param;
36     private String name = "name";
37     private String value = "value";
38
39     @Before
40     public void setUp() {
41         sdncEvent = new SDNCEvent();
42     }
43
44     @Test
45     public void testGetEventType() {
46         sdncEvent.setEventType("eventType");
47         Assert.assertNotNull(sdncEvent.getEventType());
48         Assert.assertEquals(sdncEvent.getEventType(), "eventType");
49     }
50
51     @Test
52     public void testGetEventCorrelatorType() {
53         sdncEvent.setEventCorrelatorType("eventCorrelatorType");
54         Assert.assertNotNull(sdncEvent.getEventCorrelatorType());
55         Assert.assertEquals(sdncEvent.getEventCorrelatorType(), "eventCorrelatorType");
56     }
57
58     @Test
59     public void testGetEventCorrelator() {
60         sdncEvent.setEventCorrelator("eventCorrelator");
61         Assert.assertNotNull(sdncEvent.getEventCorrelator());
62         Assert.assertEquals(sdncEvent.getEventCorrelator(), "eventCorrelator");
63     }
64
65     @Test
66     public void testGetParams() {
67         param = new HashMap<>();
68         param.put("paramKey", "paramValue");
69         sdncEvent.setParams(param);
70         Assert.assertNotNull(sdncEvent.getParams());
71         Assert.assertTrue(sdncEvent.getParams().containsKey("paramKey"));
72         Assert.assertTrue(sdncEvent.getParams().containsValue("paramValue"));
73     }
74
75     @Test
76     public void testAddParam() {
77         sdncEvent.addParam("name", "value");
78
79     }
80
81 }