2 * Copyright 2017 ZTE Corporation.
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
16 package org.onap.holmes.common.api.entity;
\r
18 import org.junit.After;
\r
19 import org.junit.Before;
\r
20 import org.junit.Test;
\r
22 import static org.hamcrest.core.IsEqual.equalTo;
\r
23 import static org.junit.Assert.assertThat;
\r
25 public class AlarmInfoTest {
\r
27 private AlarmInfo alarmInfo;
\r
30 public void before() throws Exception {
\r
31 alarmInfo = new AlarmInfo();
\r
35 public void after() throws Exception {
\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
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
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
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
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
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
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
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