unit test for FlowClassfierReq4N
[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  * <p>
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  * <p>
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * <p>
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 package org.onap.sfc.entity;
17
18 import org.junit.Before;
19 import org.junit.Test;
20
21 import static org.junit.Assert.*;
22
23 public class FlowClassfierReq4NTest {
24     FlowClassfierReq4N flowClassfierReq4N;
25
26     @Before
27     public void setUp() throws Exception {
28         flowClassfierReq4N = new FlowClassfierReq4N();
29     }
30
31     @Test
32     public void getAndSetUrl() throws Exception {
33         String url = "http://0.0.0.0:8080";
34         flowClassfierReq4N.setUrl(url);
35         assert flowClassfierReq4N.getUrl().equals(url);
36     }
37
38     @Test
39     public void getAndSetSdnControllerId() throws Exception {
40         String sdnControllerId = "123-456-789";
41         flowClassfierReq4N.setSdnControllerId(sdnControllerId);
42         assert flowClassfierReq4N.getSdnControllerId().equals(sdnControllerId);
43     }
44
45     @Test
46     public void getAndSetName() throws Exception {
47         String name = "name";
48         flowClassfierReq4N.setName(name);
49         assert flowClassfierReq4N.getName().equals(name);
50     }
51
52     @Test
53     public void getAndSetDescription() throws Exception {
54         String description = "description";
55         flowClassfierReq4N.setDescription(description);
56         assert  flowClassfierReq4N.getDescription().equals(description);
57     }
58
59     @Test
60     public void getAndSetDscp() throws Exception {
61         int dscp = 0;
62         flowClassfierReq4N.setDscp(dscp);
63         assert flowClassfierReq4N.getDscp() == dscp;
64     }
65
66     @Test
67     public void getAndSetIp_proto() throws Exception {
68         String ip_proto = "ISIS";
69         flowClassfierReq4N.setIp_proto(ip_proto);
70         assert flowClassfierReq4N.getIp_proto().equals(ip_proto);
71     }
72
73     @Test
74     public void getAndSetSource_port_range() throws Exception {
75         String source_port_range = "1-400";
76         flowClassfierReq4N.setSource_port_range(source_port_range);
77         assert flowClassfierReq4N.getSource_port_range().equals(source_port_range);
78     }
79
80     @Test
81     public void getAndSetDest_port_range() throws Exception {
82         String dest_port_range = "1-400";
83         flowClassfierReq4N.setDest_port_range(dest_port_range);
84         assert flowClassfierReq4N.getDest_port_range().equals(dest_port_range);
85     }
86
87     @Test
88     public void getAndSetSource_ip_range() throws Exception {
89         String source_ip_range = "0.0.0.0-1.1.1.1";
90         flowClassfierReq4N.setSource_ip_range(source_ip_range);
91         assert flowClassfierReq4N.getSource_ip_range().equals(source_ip_range);
92     }
93
94     @Test
95     public void getAndSetDest_ip_range() throws Exception {
96         String dest_ip_range = "0.0.0.0-1.1.1.1";
97         flowClassfierReq4N.setDest_ip_range(dest_ip_range);
98         assert flowClassfierReq4N.getDest_ip_range().equals(dest_ip_range);
99     }
100
101 }