add alarm synchronization related operation
[holmes/common.git] / holmes-actions / src / test / java / org / onap / holmes / common / api / entity / AlarmInfoTest.java
1 /**\r
2  * Copyright 2017 ZTE Corporation.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 package org.onap.holmes.common.api.entity;\r
17 \r
18 import org.junit.After;\r
19 import org.junit.Before;\r
20 import org.junit.Test;\r
21 \r
22 import static org.hamcrest.core.IsEqual.equalTo;\r
23 import static org.junit.Assert.assertThat;\r
24 \r
25 public class AlarmInfoTest {\r
26 \r
27     private AlarmInfo alarmInfo;\r
28 \r
29     @Before\r
30     public void before() throws Exception {\r
31         alarmInfo = new AlarmInfo();\r
32     }\r
33 \r
34     @After\r
35     public void after() throws Exception {\r
36 \r
37     }\r
38 \r
39     @Test\r
40     public void getterAndSetter4EventID() throws Exception {\r
41         final String eventID = "eventId";\r
42         alarmInfo.setEventId(eventID);\r
43         assertThat(alarmInfo.getEventId(), equalTo(eventID));\r
44     }\r
45 \r
46     @Test\r
47     public void getterAndSetter4EventName() throws Exception {\r
48         final String eventName = "eventName";\r
49         alarmInfo.setEventName(eventName);\r
50         assertThat(alarmInfo.getEventName(), equalTo(eventName));\r
51     }\r
52 \r
53     @Test\r
54     public void getterAndSetter4StartEpochMicroSec() throws Exception {\r
55         final long startEpochMicroSec = 1L;\r
56         alarmInfo.setStartEpochMicroSec(startEpochMicroSec);\r
57         assertThat(alarmInfo.getStartEpochMicroSec(), equalTo(startEpochMicroSec));\r
58     }\r
59 \r
60     @Test\r
61     public void getterAndSetter4LastEpochMicroSec() throws Exception {\r
62         final long lastEpochMicroSec = 1L;\r
63         alarmInfo.setLastEpochMicroSec(lastEpochMicroSec);\r
64         assertThat(alarmInfo.getLastEpochMicroSec(), equalTo(lastEpochMicroSec));\r
65     }\r
66 \r
67     @Test\r
68     public void getterAndSetter4SourceID() throws Exception {\r
69         final String sourceID = "sourceId";\r
70         alarmInfo.setSourceId(sourceID);\r
71         assertThat(alarmInfo.getSourceId(), equalTo(sourceID));\r
72     }\r
73 \r
74     @Test\r
75     public void getterAndSetter4SourceName() throws Exception {\r
76         final String sourceName = "sourceName";\r
77         alarmInfo.setSourceName(sourceName);\r
78         assertThat(alarmInfo.getSourceName(), equalTo(sourceName));\r
79     }\r
80 \r
81     @Test\r
82     public void getterAndSetter4AlarmIsCleared() throws Exception {\r
83         final int alarmIsCleared = 1;\r
84         alarmInfo.setAlarmIsCleared(alarmIsCleared);\r
85         assertThat(alarmInfo.getAlarmIsCleared(), equalTo(alarmIsCleared));\r
86     }\r
87 \r
88     @Test\r
89     public void getterAndSetter4RootFlag() throws Exception {\r
90         final int rootFlag = 1;\r
91         alarmInfo.setRootFlag(rootFlag);\r
92         assertThat(alarmInfo.getRootFlag(), equalTo(rootFlag));\r
93     }\r
94 }\r