8e16ce633748ab6f1ec305103613de9dd1194409
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / onap / so / client / cds / beans / ConfigDeployPropertiesForPnfTest.java
1 package org.onap.so.client.cds.beans;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5
6 import org.junit.Before;
7 import org.junit.Test;
8
9 public class ConfigDeployPropertiesForPnfTest {
10
11     ConfigDeployPropertiesForPnf configDeployPropertiesForPnf = new ConfigDeployPropertiesForPnf();
12     private static final String TEST_SERVICE_MODEL_UUID = "service-model-uuid";
13     private static final String TEST_PNF_CUSTOMIZATION_UUID = "pnf-customization-uuid";
14     private static final String TEST_PNF_ID = "pnf-id";
15     private static final String TEST_PNF_NAME = "pnf-name";
16     private static final String TEST_PNF_IP_V4_ADDRESS = "1.1.1.1";
17     private static final String TEST_PNF_IP_V6_ADDRESS = "::/128";
18     private static final String TEST_SERVICE_INSTANCE_ID = "service-instance-id";
19
20     @Before
21     public void setUp(){
22         configDeployPropertiesForPnf.setServiceInstanceId(TEST_SERVICE_INSTANCE_ID);
23         configDeployPropertiesForPnf.setServiceModelUuid(TEST_SERVICE_MODEL_UUID);
24         configDeployPropertiesForPnf.setPnfCustomizationUuid(TEST_PNF_CUSTOMIZATION_UUID);
25         configDeployPropertiesForPnf.setPnfId(TEST_PNF_ID);
26         configDeployPropertiesForPnf.setPnfName(TEST_PNF_NAME);
27         configDeployPropertiesForPnf.setPnfIpV4Address(TEST_PNF_IP_V4_ADDRESS);
28         configDeployPropertiesForPnf.setPnfIpV6Address(TEST_PNF_IP_V6_ADDRESS);
29     }
30
31     @Test
32     public final void testConfigDeployPropertiesForPnfTest() {
33         assertNotNull(configDeployPropertiesForPnf.getServiceInstanceId());
34         assertNotNull(configDeployPropertiesForPnf.getServiceModelUuid());
35         assertNotNull(configDeployPropertiesForPnf.getPnfCustomizationUuid());
36         assertNotNull(configDeployPropertiesForPnf.getPnfId());
37         assertNotNull(configDeployPropertiesForPnf.getPnfName());
38
39         assertEquals(TEST_SERVICE_INSTANCE_ID, configDeployPropertiesForPnf.getServiceInstanceId());
40         assertEquals(TEST_SERVICE_MODEL_UUID, configDeployPropertiesForPnf.getServiceModelUuid());
41         assertEquals(TEST_PNF_CUSTOMIZATION_UUID, configDeployPropertiesForPnf.getPnfCustomizationUuid());
42         assertEquals(TEST_PNF_ID, configDeployPropertiesForPnf.getPnfId());
43         assertEquals(TEST_PNF_NAME, configDeployPropertiesForPnf.getPnfName());
44         assertEquals(TEST_PNF_IP_V4_ADDRESS, configDeployPropertiesForPnf.getPnfIpV4Address());
45         assertEquals(TEST_PNF_IP_V6_ADDRESS, configDeployPropertiesForPnf.getPnfIpV6Address());
46
47     }
48
49     @Test
50     public void testtoString() {
51         final StringBuilder sb = new StringBuilder("{");
52         sb.append("\"service-instance-id\":").append("\"").append(TEST_SERVICE_INSTANCE_ID).append("\"");
53         sb.append(", \"pnf-id\":").append("\"").append(TEST_PNF_ID).append("\"");
54         sb.append(", \"pnf-name\":").append("\"").append(TEST_PNF_NAME).append("\"");
55         sb.append(", \"pnf-ipv4-address\":").append("\"").append(TEST_PNF_IP_V4_ADDRESS).append("\"");
56         sb.append(", \"pnf-ipv6-address\":").append("\"").append(TEST_PNF_IP_V6_ADDRESS).append("\"");
57         sb.append(", \"service-model-uuid\":").append("\"").append(TEST_SERVICE_MODEL_UUID).append("\"");
58         sb.append(", \"pnf-customization-uuid\":").append("\"").append(TEST_PNF_CUSTOMIZATION_UUID).append("\"");
59         sb.append('}');
60         String Expexted = sb.toString();
61         assertEquals(Expexted, configDeployPropertiesForPnf.toString());
62     }
63
64 }