fix catalogdb cvfnc customization
[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         Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomizationSet = new HashSet();
60         cvnfcConfigurationCustomizationSet.add(setupCvnfcConfigurationCustomization());
61         cvnfcCustomization.setCvnfcConfigurationCustomization(cvnfcConfigurationCustomizationSet);
62
63         assertTrue (cvnfcCustomization.getId().equals (new Integer(1)));
64         assertTrue (cvnfcCustomization.getDescription().equals (DESCRIPTION));
65         assertTrue (cvnfcCustomization.getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
66         assertTrue (cvnfcCustomization.getModelInstanceName().equals (MODEL_INSTANCE_NAME));
67         assertTrue (cvnfcCustomization.getModelInvariantUUID().equals (MODEL_INVARIANT_UUID));
68         assertTrue (cvnfcCustomization.getModelName().equals (MODEL_NAME));
69         assertTrue (cvnfcCustomization.getModelUUID().equals (MODEL_UUID));
70         assertTrue (cvnfcCustomization.getModelVersion().equals (MODEL_VERSION));
71         assertTrue (cvnfcCustomization.getNfcFunction().equals (NFC_FUNCTION));
72         assertTrue (cvnfcCustomization.getNfcNamingCode().equals (NFC_NAMING_CODE));
73         assertTrue (cvnfcCustomization.getToscaNodeType().equals (TOSCA_NODE_TYPE));
74         assertTrue (cvnfcCustomization.getVfModuleCustomization().getModelCustomizationUUID().equals (MODEL_CUSTOMIZATION_UUID));
75     }
76     
77     private VfModuleCustomization setupVfModuleCustomization(){
78         VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
79         vfModuleCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
80         return vfModuleCustomization;
81     }
82
83     
84     private CvnfcConfigurationCustomization setupCvnfcConfigurationCustomization(){
85         CvnfcConfigurationCustomization cvnfcConfigurationCustomization = new CvnfcConfigurationCustomization();
86         cvnfcConfigurationCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
87         return cvnfcConfigurationCustomization;
88     }
89 }