Add service node entity class
[holmes/common.git] / holmes-actions / src / test / java / org / onap / holmes / common / api / entity / ServiceNode4QueryTest.java
1 /**
2  * Copyright 2017 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.holmes.common.api.entity;
18
19
20 import org.junit.After;
21 import org.junit.Before;
22 import org.junit.Test;
23
24 import static org.hamcrest.core.IsEqual.equalTo;
25 import static org.junit.Assert.assertThat;
26
27 public class ServiceNode4QueryTest {
28     private ServiceNode4Query serviceNode4Query;
29
30     @Before
31     public void before()throws Exception{
32         serviceNode4Query = new ServiceNode4Query();
33     }
34     @After
35     public void after()throws Exception{}
36
37     @Test
38     public void getterAndSetter4Ip() throws Exception{
39         final String ip = "ip";
40         serviceNode4Query.setIp(ip);
41         assertThat(serviceNode4Query.getIp(), equalTo(ip));
42     }
43
44     @Test
45     public void getterAndSetter4Port() throws Exception{
46         final String port = "port";
47         serviceNode4Query.setPort(port);
48         assertThat(serviceNode4Query.getPort(), equalTo(port));
49     }
50
51     @Test
52     public void getterAndSetter4CheckType() throws Exception{
53         final String checkType = "checkType";
54         serviceNode4Query.setCheckType(checkType);
55         assertThat(serviceNode4Query.getCheckType(), equalTo(checkType));
56     }
57
58     @Test
59     public void getterAndSetter4checkUrl() throws Exception{
60         final String checkUrl = "checkUrl";
61         serviceNode4Query.setCheckUrl(checkUrl);
62         assertThat(serviceNode4Query.getCheckUrl(), equalTo(checkUrl));
63     }
64
65     @Test
66     public void getterAndSetter4hHa_role() throws Exception{
67         final String ha_role = "ha_role";
68         serviceNode4Query.setHa_role(ha_role);
69         assertThat(serviceNode4Query.getHa_role(), equalTo(ha_role));
70     }
71
72     @Test
73     public void getterAndSetter4NodeId() throws Exception{
74         final String nodeId = "nodeId";
75         serviceNode4Query.setNodeId(nodeId);
76         assertThat(serviceNode4Query.getNodeId(), equalTo(nodeId));
77     }
78
79     @Test
80     public void getterAndSetter4Status() throws Exception{
81         final String status = "status";
82         serviceNode4Query.setStatus(status);
83         assertThat(serviceNode4Query.getStatus(), equalTo(status));
84     }
85
86
87 }