f771710f8b60bf1dd8abf18cf62089c4ff113cc9
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / onap / so / client / cds / beans / ConfigDeployRequestVnfTest.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.Test;
7
8 public class ConfigDeployRequestVnfTest {
9
10     ConfigDeployRequestVnf configDeployRequestVnf = new ConfigDeployRequestVnf();
11     private String resolutionKey;
12     ConfigDeployPropertiesForVnf configDeployPropertiesForVnf = new ConfigDeployPropertiesForVnf();
13
14     @Test
15     public final void testConfigDeployRequestVnf() {
16         configDeployRequestVnf.setResolutionKey("resolution-key");
17         configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf);
18         assertNotNull(configDeployRequestVnf.getResolutionKey());
19         assertNotNull(configDeployRequestVnf.getConfigDeployPropertiesForVnf());
20         assertEquals("resolution-key", configDeployRequestVnf.getResolutionKey());
21         assertEquals(configDeployPropertiesForVnf, configDeployRequestVnf.getConfigDeployPropertiesForVnf());
22     }
23
24     @Test
25     public void testtoString() {
26         configDeployPropertiesForVnf.setServiceInstanceId("service-instance-id");
27         configDeployPropertiesForVnf.setServiceModelUuid("service-model-uuid");
28         configDeployPropertiesForVnf.setVnfCustomizationUuid("vnf-customization-uuid");
29         configDeployPropertiesForVnf.setVnfId("vnf-id");
30         configDeployPropertiesForVnf.setVnfName("vnf-name");
31         configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf);
32         final StringBuilder sb = new StringBuilder("{\"config-deploy-request\":{");
33         sb.append("\"resolution-key\":").append("\"").append(resolutionKey).append("\"");
34         sb.append(", \"config-deploy-properties\":").append(configDeployPropertiesForVnf.toString());
35         sb.append('}');
36         sb.append('}');
37         String Expexted = sb.toString();
38
39         assertEquals(Expexted, configDeployRequestVnf.toString());
40     }
41
42 }