aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/beans/ConfigDeployRequestVnfTest.java
blob: f771710f8b60bf1dd8abf18cf62089c4ff113cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.onap.so.client.cds.beans;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import org.junit.Test;

public class ConfigDeployRequestVnfTest {

    ConfigDeployRequestVnf configDeployRequestVnf = new ConfigDeployRequestVnf();
    private String resolutionKey;
    ConfigDeployPropertiesForVnf configDeployPropertiesForVnf = new ConfigDeployPropertiesForVnf();

    @Test
    public final void testConfigDeployRequestVnf() {
        configDeployRequestVnf.setResolutionKey("resolution-key");
        configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf);
        assertNotNull(configDeployRequestVnf.getResolutionKey());
        assertNotNull(configDeployRequestVnf.getConfigDeployPropertiesForVnf());
        assertEquals("resolution-key", configDeployRequestVnf.getResolutionKey());
        assertEquals(configDeployPropertiesForVnf, configDeployRequestVnf.getConfigDeployPropertiesForVnf());
    }

    @Test
    public void testtoString() {
        configDeployPropertiesForVnf.setServiceInstanceId("service-instance-id");
        configDeployPropertiesForVnf.setServiceModelUuid("service-model-uuid");
        configDeployPropertiesForVnf.setVnfCustomizationUuid("vnf-customization-uuid");
        configDeployPropertiesForVnf.setVnfId("vnf-id");
        configDeployPropertiesForVnf.setVnfName("vnf-name");
        configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf);
        final StringBuilder sb = new StringBuilder("{\"config-deploy-request\":{");
        sb.append("\"resolution-key\":").append("\"").append(resolutionKey).append("\"");
        sb.append(", \"config-deploy-properties\":").append(configDeployPropertiesForVnf.toString());
        sb.append('}');
        sb.append('}');
        String Expexted = sb.toString();

        assertEquals(Expexted, configDeployRequestVnf.toString());
    }

}