License agreement changes
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / onap / so / client / cds / beans / ConfigDeployPropertiesForPnfTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2019 TechMahindra
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.client.cds.beans;
22
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotNull;
25 import org.junit.Before;
26 import org.junit.Test;
27
28 public class ConfigDeployPropertiesForPnfTest {
29
30     ConfigDeployPropertiesForPnf configDeployPropertiesForPnf = new ConfigDeployPropertiesForPnf();
31     private static final String TEST_SERVICE_MODEL_UUID = "service-model-uuid";
32     private static final String TEST_PNF_CUSTOMIZATION_UUID = "pnf-customization-uuid";
33     private static final String TEST_PNF_ID = "pnf-id";
34     private static final String TEST_PNF_NAME = "pnf-name";
35     private static final String TEST_PNF_IP_V4_ADDRESS = "1.1.1.1";
36     private static final String TEST_PNF_IP_V6_ADDRESS = "::/128";
37     private static final String TEST_SERVICE_INSTANCE_ID = "service-instance-id";
38
39     @Before
40     public void setUp() {
41         configDeployPropertiesForPnf.setServiceInstanceId(TEST_SERVICE_INSTANCE_ID);
42         configDeployPropertiesForPnf.setServiceModelUuid(TEST_SERVICE_MODEL_UUID);
43         configDeployPropertiesForPnf.setPnfCustomizationUuid(TEST_PNF_CUSTOMIZATION_UUID);
44         configDeployPropertiesForPnf.setPnfId(TEST_PNF_ID);
45         configDeployPropertiesForPnf.setPnfName(TEST_PNF_NAME);
46         configDeployPropertiesForPnf.setPnfIpV4Address(TEST_PNF_IP_V4_ADDRESS);
47         configDeployPropertiesForPnf.setPnfIpV6Address(TEST_PNF_IP_V6_ADDRESS);
48     }
49
50     @Test
51     public final void testConfigDeployPropertiesForPnfTest() {
52         assertNotNull(configDeployPropertiesForPnf.getServiceInstanceId());
53         assertNotNull(configDeployPropertiesForPnf.getServiceModelUuid());
54         assertNotNull(configDeployPropertiesForPnf.getPnfCustomizationUuid());
55         assertNotNull(configDeployPropertiesForPnf.getPnfId());
56         assertNotNull(configDeployPropertiesForPnf.getPnfName());
57
58         assertEquals(TEST_SERVICE_INSTANCE_ID, configDeployPropertiesForPnf.getServiceInstanceId());
59         assertEquals(TEST_SERVICE_MODEL_UUID, configDeployPropertiesForPnf.getServiceModelUuid());
60         assertEquals(TEST_PNF_CUSTOMIZATION_UUID, configDeployPropertiesForPnf.getPnfCustomizationUuid());
61         assertEquals(TEST_PNF_ID, configDeployPropertiesForPnf.getPnfId());
62         assertEquals(TEST_PNF_NAME, configDeployPropertiesForPnf.getPnfName());
63         assertEquals(TEST_PNF_IP_V4_ADDRESS, configDeployPropertiesForPnf.getPnfIpV4Address());
64         assertEquals(TEST_PNF_IP_V6_ADDRESS, configDeployPropertiesForPnf.getPnfIpV6Address());
65
66     }
67
68     @Test
69     public void testtoString() {
70         final StringBuilder sb = new StringBuilder("{");
71         sb.append("\"service-instance-id\":").append("\"").append(TEST_SERVICE_INSTANCE_ID).append("\"");
72         sb.append(", \"pnf-id\":").append("\"").append(TEST_PNF_ID).append("\"");
73         sb.append(", \"pnf-name\":").append("\"").append(TEST_PNF_NAME).append("\"");
74         sb.append(", \"pnf-ipv4-address\":").append("\"").append(TEST_PNF_IP_V4_ADDRESS).append("\"");
75         sb.append(", \"pnf-ipv6-address\":").append("\"").append(TEST_PNF_IP_V6_ADDRESS).append("\"");
76         sb.append(", \"service-model-uuid\":").append("\"").append(TEST_SERVICE_MODEL_UUID).append("\"");
77         sb.append(", \"pnf-customization-uuid\":").append("\"").append(TEST_PNF_CUSTOMIZATION_UUID).append("\"");
78         sb.append('}');
79         String Expexted = sb.toString();
80         assertEquals(Expexted, configDeployPropertiesForPnf.toString());
81     }
82
83 }