added generic fabric support to SO
[so.git] / mso-catalog-db / src / test / java / org / onap / so / db / catalog / beans / CvnfcCustomizationTest.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.HashSet;
26 import java.util.Set;
27
28 import org.junit.Test;
29
30 public class CvnfcCustomizationTest {
31         
32         private static final Integer ID = new Integer(1);
33         private static final String DESCRIPTION = "testDescription";
34         private static final String MODEL_CUSTOMIZATION_UUID = "testModelCustomizationUUID";
35         private static final String MODEL_INSTANCE_NAME = "testModelInstanceName";
36         private static final String MODEL_INVARIANT_UUID = "testModelInvariantUUID";
37         private static final String MODEL_NAME = "testModelName";
38         private static final String MODEL_UUID = "testModelUUID";
39         private static final String MODEL_VERSION = "testModelVersion";
40         private static final String TOSCA_NODE_TYPE = "testToscaNodeType";
41         private static final String NFC_FUNCTION = "testNfcFunction";
42         private static final String NFC_NAMING_CODE = "testNfcNamingCode";
43         
44     @Test
45     public final void testCvnfcCustomization () {
46         CvnfcCustomization cvnfcCustomization = new CvnfcCustomization();
47         cvnfcCustomization.setDescription(DESCRIPTION);
48         cvnfcCustomization.setId(ID);
49         cvnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
50         cvnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
51         cvnfcCustomization.setModelInvariantUUID(MODEL_INVARIANT_UUID);
52         cvnfcCustomization.setModelName(MODEL_NAME);
53         cvnfcCustomization.setModelUUID(MODEL_UUID);
54         cvnfcCustomization.setModelVersion(MODEL_VERSION);
55         cvnfcCustomization.setNfcFunction(NFC_FUNCTION);
56         cvnfcCustomization.setNfcNamingCode(NFC_NAMING_CODE);
57         cvnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
58         cvnfcCustomization.setVfModuleCustomization(setupVfModuleCustomization());
59         cvnfcCustomization.setVnfcCustomization(setupVnfcCustomization());
60         cvnfcCustomization.setVnfResourceCustomization(setupVnfResourceCustomization());
61         Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationSet = new HashSet();
62         vnfVfmoduleCvnfcConfigurationCustomizationSet.add(setupVnfVfmoduleCvnfcConfigurationCustomization());
63         cvnfcCustomization.setVnfVfmoduleCvnfcConfigurationCustomization(vnfVfmoduleCvnfcConfigurationCustomizationSet);
64
65         assertTrue (cvnfcCustomization.getId().equals (new Integer(1)));
66         assertTrue (cvnfcCustomization.getDescription().equals (DESCRIPTION));
67         assertTrue (cvnfcCustomization.getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
68         assertTrue (cvnfcCustomization.getModelInstanceName().equals (MODEL_INSTANCE_NAME));
69         assertTrue (cvnfcCustomization.getModelInvariantUUID().equals (MODEL_INVARIANT_UUID));
70         assertTrue (cvnfcCustomization.getModelName().equals (MODEL_NAME));
71         assertTrue (cvnfcCustomization.getModelUUID().equals (MODEL_UUID));
72         assertTrue (cvnfcCustomization.getModelVersion().equals (MODEL_VERSION));
73         assertTrue (cvnfcCustomization.getNfcFunction().equals (NFC_FUNCTION));
74         assertTrue (cvnfcCustomization.getNfcNamingCode().equals (NFC_NAMING_CODE));
75         assertTrue (cvnfcCustomization.getToscaNodeType().equals (TOSCA_NODE_TYPE));
76         assertTrue (cvnfcCustomization.getVnfcCustomization().getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
77         assertTrue (cvnfcCustomization.getVfModuleCustomization().getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
78     }
79     
80     private VfModuleCustomization setupVfModuleCustomization(){
81         VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
82         vfModuleCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
83         return vfModuleCustomization;
84     }
85     
86     private VnfcCustomization setupVnfcCustomization(){
87         VnfcCustomization vnfcCustomization = new VnfcCustomization();
88         vnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
89         return vnfcCustomization;
90     }
91     
92     private VnfResourceCustomization setupVnfResourceCustomization(){
93         VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization();
94         vnfResourceCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
95         return vnfResourceCustomization;
96     }
97     
98     private VnfVfmoduleCvnfcConfigurationCustomization setupVnfVfmoduleCvnfcConfigurationCustomization(){
99         VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new VnfVfmoduleCvnfcConfigurationCustomization();
100         vnfVfmoduleCvnfcConfigurationCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
101         return vnfVfmoduleCvnfcConfigurationCustomization;
102     }
103 }