686942a6b3191c8b3cab0cb8f32b545c9e9d58ed
[ccsdk/features.git] / sdnr / wt / devicemanager-onap / onf14 / provider / src / test / java / org / onap / ccsdk / features / sdnr / wt / devicemanager / onf14 / TestSeverity.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14;
23
24 import static org.junit.Assert.assertTrue;
25 import org.junit.Test;
26 import org.mockito.Mockito;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14AirInterface;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14WireInterface;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
30
31 public class TestSeverity extends Mockito {
32
33     @Test
34     public void test1_1() {
35         assertTrue(Onf14WireInterface.mapSeverity(
36                 org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPECRITICAL.class)
37                 .equals(SeverityType.Critical));
38     }
39
40     @Test
41     public void test1_2() {
42         assertTrue(Onf14WireInterface.mapSeverity(
43                 org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEWARNING.class)
44                 .equals(SeverityType.Warning));
45     }
46
47     @Test
48     public void test1_3() {
49         assertTrue(Onf14WireInterface.mapSeverity(
50                 org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMINOR.class)
51                 .equals(SeverityType.Minor));
52     }
53
54     @Test
55     public void test1_4() {
56         assertTrue(Onf14WireInterface.mapSeverity(
57                 org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMAJOR.class)
58                 .equals(SeverityType.Major));
59     }
60
61     public void test2_1() {
62         assertTrue(Onf14AirInterface.mapSeverity(
63                 org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPECRITICAL.class)
64                 .equals(SeverityType.Critical));
65     }
66
67     @Test
68     public void test2_2() {
69         assertTrue(Onf14AirInterface.mapSeverity(
70                 org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPEMINOR.class)
71                 .equals(SeverityType.Minor));
72     }
73
74     @Test
75     public void test2_3() {
76         assertTrue(Onf14AirInterface.mapSeverity(null).equals(SeverityType.NonAlarmed));
77     }
78
79
80 }