added generic fabric support to SO
[so.git] / mso-catalog-db / src / test / java / org / onap / so / db / catalog / beans / VnfcCustomizationTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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.db.catalog.beans;
22
23 import static org.junit.Assert.assertTrue;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 import org.junit.Test;
29
30 public class VnfcCustomizationTest {
31         
32         private static final String DESCRIPTION = "testDescription";
33         private static final String MODEL_CUSTOMIZATION_UUID = "testModelCustomizationUUID";
34         private static final String MODEL_INSTANCE_NAME = "testModelInstanceName";
35         private static final String MODEL_INVARIANT_UUID = "testModelInvariantUUID";
36         private static final String MODEL_NAME = "testModelName";
37         private static final String MODEL_UUID = "testModelUUID";
38         private static final String MODEL_VERSION = "testModelVersion";
39         private static final String TOSCA_NODE_TYPE = "testToscaNodeType";
40         
41     @Test
42     public final void testVnfcCustomization () {
43         VnfcCustomization vnfcCustomization = new VnfcCustomization();
44         vnfcCustomization.setCvnfcCustomization(setupCvnfcCustomizationList());
45         vnfcCustomization.setDescription(DESCRIPTION);
46         vnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
47         vnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
48         vnfcCustomization.setModelInvariantUUID(MODEL_INVARIANT_UUID);
49         vnfcCustomization.setModelName(MODEL_NAME);
50         vnfcCustomization.setModelUUID(MODEL_UUID);
51         vnfcCustomization.setModelVersion(MODEL_VERSION);
52         vnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
53         
54         assertTrue (vnfcCustomization.getDescription().equals (DESCRIPTION));
55         assertTrue (vnfcCustomization.getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
56         assertTrue (vnfcCustomization.getModelInstanceName().equals (MODEL_INSTANCE_NAME));
57         assertTrue (vnfcCustomization.getModelInvariantUUID().equals (MODEL_INVARIANT_UUID));
58         assertTrue (vnfcCustomization.getModelName().equals (MODEL_NAME));
59         assertTrue (vnfcCustomization.getModelUUID().equals (MODEL_UUID));
60         assertTrue (vnfcCustomization.getModelVersion().equals (MODEL_VERSION));
61         assertTrue (vnfcCustomization.getToscaNodeType().equals (TOSCA_NODE_TYPE));
62         assertTrue (vnfcCustomization.getCvnfcCustomization().get(0).getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
63     }
64     
65         private List<CvnfcCustomization> setupCvnfcCustomizationList(){
66         CvnfcCustomization testCvnfcCustomization = new CvnfcCustomization();
67         testCvnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
68         testCvnfcCustomization.setDescription(DESCRIPTION);
69         testCvnfcCustomization.setModelVersion(MODEL_VERSION);
70         testCvnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
71         testCvnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
72         List<CvnfcCustomization> testCvnfcCustomizationList = new ArrayList();
73         testCvnfcCustomizationList.add(testCvnfcCustomization);
74         return testCvnfcCustomizationList;
75         }
76         
77 }