2 * ============LICENSE_START=======================================================
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
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.openecomp.mso.adapters.sdncrest;
23 import static org.junit.Assert.*;
25 import org.junit.Assert;
26 import org.junit.Before;
27 import org.junit.Test;
29 import java.util.HashMap;
32 public class SDNCEventTest {
34 private SDNCEvent sdncEvent;
35 private Map<String, String> param;
36 private String name = "name";
37 private String value = "value";
41 sdncEvent = new SDNCEvent();
45 public void testGetEventType() {
46 sdncEvent.setEventType("eventType");
47 Assert.assertNotNull(sdncEvent.getEventType());
48 Assert.assertEquals(sdncEvent.getEventType(), "eventType");
52 public void testGetEventCorrelatorType() {
53 sdncEvent.setEventCorrelatorType("eventCorrelatorType");
54 Assert.assertNotNull(sdncEvent.getEventCorrelatorType());
55 Assert.assertEquals(sdncEvent.getEventCorrelatorType(), "eventCorrelatorType");
59 public void testGetEventCorrelator() {
60 sdncEvent.setEventCorrelator("eventCorrelator");
61 Assert.assertNotNull(sdncEvent.getEventCorrelator());
62 Assert.assertEquals(sdncEvent.getEventCorrelator(), "eventCorrelator");
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"));
76 public void testAddParam() {
77 sdncEvent.addParam("name", "value");