update committer list
[vfc/nfvo/driver/sfc.git] / zte / sfc-driver / sfc-driver / src / test / java / org / onap / sfc / entity / FlowClassfierReq4NTest.java
1 /*
2  * Copyright 2018 ZTE Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.sfc.entity;
18
19 import org.junit.Before;
20 import org.junit.Test;
21
22 import static org.junit.Assert.*;
23
24 public class FlowClassfierReq4NTest {
25     FlowClassfierReq4N flowClassfierReq4N;
26
27     @Before
28     public void setUp() throws Exception {
29         flowClassfierReq4N = new FlowClassfierReq4N();
30     }
31
32     @Test
33     public void getAndSetUrl() throws Exception {
34         String url = "http://0.0.0.0:8080";
35         flowClassfierReq4N.setUrl(url);
36         assert flowClassfierReq4N.getUrl().equals(url);
37     }
38
39     @Test
40     public void getAndSetSdnControllerId() throws Exception {
41         String sdnControllerId = "123-456-789";
42         flowClassfierReq4N.setSdnControllerId(sdnControllerId);
43         assert flowClassfierReq4N.getSdnControllerId().equals(sdnControllerId);
44     }
45
46     @Test
47     public void getAndSetName() throws Exception {
48         String name = "name";
49         flowClassfierReq4N.setName(name);
50         assert flowClassfierReq4N.getName().equals(name);
51     }
52
53     @Test
54     public void getAndSetDescription() throws Exception {
55         String description = "description";
56         flowClassfierReq4N.setDescription(description);
57         assert  flowClassfierReq4N.getDescription().equals(description);
58     }
59
60     @Test
61     public void getAndSetDscp() throws Exception {
62         int dscp = 0;
63         flowClassfierReq4N.setDscp(dscp);
64         assert flowClassfierReq4N.getDscp() == dscp;
65     }
66
67     @Test
68     public void getAndSetIpProto() throws Exception {
69         String ipProto = "ISIS";
70         flowClassfierReq4N.setIpProto(ipProto);
71         assert flowClassfierReq4N.getIpProto().equals(ipProto);
72     }
73
74     @Test
75     public void getAndSetSourcePortRange() throws Exception {
76         String sourcePortRange = "1-400";
77         flowClassfierReq4N.setSourcePortRange(sourcePortRange);
78         assert flowClassfierReq4N.getSourcePortRange().equals(sourcePortRange);
79     }
80
81     @Test
82     public void getAndSetDestPortRange() throws Exception {
83         String destPortRange = "1-400";
84         flowClassfierReq4N.setDestPortRange(destPortRange);
85         assert flowClassfierReq4N.getDestPortRange().equals(destPortRange);
86     }
87
88     @Test
89     public void getAndSetSourceIpRange() throws Exception {
90         String sourceIpRange = "0.0.0.0-1.1.1.1";
91         flowClassfierReq4N.setSourceIpRange(sourceIpRange);
92         assert flowClassfierReq4N.getSourceIpRange().equals(sourceIpRange);
93     }
94
95     @Test
96     public void getAndSetDestIpRange() throws Exception {
97         String destIpRange = "0.0.0.0-1.1.1.1";
98         flowClassfierReq4N.setDestIpRange(destIpRange);
99         assert flowClassfierReq4N.getDestIpRange().equals(destIpRange);
100     }
101
102 }