+/**\r
+ * Copyright 2017 ZTE Corporation.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.onap.holmes.common.api.entity;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import static org.hamcrest.core.IsEqual.equalTo;\r
+import static org.junit.Assert.assertThat;\r
+\r
+public class AlarmInfoTest {\r
+\r
+ private AlarmInfo alarmInfo;\r
+\r
+ @Before\r
+ public void before() throws Exception {\r
+ alarmInfo = new AlarmInfo();\r
+ }\r
+\r
+ @After\r
+ public void after() throws Exception {\r
+\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4EventID() throws Exception {\r
+ final String eventID = "eventId";\r
+ alarmInfo.setEventId(eventID);\r
+ assertThat(alarmInfo.getEventId(), equalTo(eventID));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4EventName() throws Exception {\r
+ final String eventName = "eventName";\r
+ alarmInfo.setEventName(eventName);\r
+ assertThat(alarmInfo.getEventName(), equalTo(eventName));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4StartEpochMicroSec() throws Exception {\r
+ final long startEpochMicroSec = 1L;\r
+ alarmInfo.setStartEpochMicroSec(startEpochMicroSec);\r
+ assertThat(alarmInfo.getStartEpochMicroSec(), equalTo(startEpochMicroSec));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4LastEpochMicroSec() throws Exception {\r
+ final long lastEpochMicroSec = 1L;\r
+ alarmInfo.setLastEpochMicroSec(lastEpochMicroSec);\r
+ assertThat(alarmInfo.getLastEpochMicroSec(), equalTo(lastEpochMicroSec));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4SourceID() throws Exception {\r
+ final String sourceID = "sourceId";\r
+ alarmInfo.setSourceId(sourceID);\r
+ assertThat(alarmInfo.getSourceId(), equalTo(sourceID));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4SourceName() throws Exception {\r
+ final String sourceName = "sourceName";\r
+ alarmInfo.setSourceName(sourceName);\r
+ assertThat(alarmInfo.getSourceName(), equalTo(sourceName));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4AlarmIsCleared() throws Exception {\r
+ final int alarmIsCleared = 1;\r
+ alarmInfo.setAlarmIsCleared(alarmIsCleared);\r
+ assertThat(alarmInfo.getAlarmIsCleared(), equalTo(alarmIsCleared));\r
+ }\r
+\r
+ @Test\r
+ public void getterAndSetter4RootFlag() throws Exception {\r
+ final int rootFlag = 1;\r
+ alarmInfo.setRootFlag(rootFlag);\r
+ assertThat(alarmInfo.getRootFlag(), equalTo(rootFlag));\r
+ }\r
+}\r