2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.db.catalog.beans;
23 import static org.junit.Assert.assertTrue;
24 import java.util.HashSet;
26 import org.junit.Test;
28 public class CvnfcCustomizationTest {
30 private static final Integer ID = new Integer(1);
31 private static final String DESCRIPTION = "testDescription";
32 private static final String MODEL_CUSTOMIZATION_UUID = "testModelCustomizationUUID";
33 private static final String MODEL_INSTANCE_NAME = "testModelInstanceName";
34 private static final String MODEL_INVARIANT_UUID = "testModelInvariantUUID";
35 private static final String MODEL_NAME = "testModelName";
36 private static final String MODEL_UUID = "testModelUUID";
37 private static final String MODEL_VERSION = "testModelVersion";
38 private static final String TOSCA_NODE_TYPE = "testToscaNodeType";
39 private static final String NFC_FUNCTION = "testNfcFunction";
40 private static final String NFC_NAMING_CODE = "testNfcNamingCode";
43 public final void testCvnfcCustomization() {
44 CvnfcCustomization cvnfcCustomization = new CvnfcCustomization();
45 cvnfcCustomization.setDescription(DESCRIPTION);
46 cvnfcCustomization.setId(ID);
47 cvnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
48 cvnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
49 cvnfcCustomization.setModelInvariantUUID(MODEL_INVARIANT_UUID);
50 cvnfcCustomization.setModelName(MODEL_NAME);
51 cvnfcCustomization.setModelUUID(MODEL_UUID);
52 cvnfcCustomization.setModelVersion(MODEL_VERSION);
53 cvnfcCustomization.setNfcFunction(NFC_FUNCTION);
54 cvnfcCustomization.setNfcNamingCode(NFC_NAMING_CODE);
55 cvnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
56 cvnfcCustomization.setVfModuleCustomization(setupVfModuleCustomization());
57 Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomizationSet = new HashSet();
58 cvnfcConfigurationCustomizationSet.add(setupCvnfcConfigurationCustomization());
59 cvnfcCustomization.setCvnfcConfigurationCustomization(cvnfcConfigurationCustomizationSet);
61 assertTrue(cvnfcCustomization.getId().equals(new Integer(1)));
62 assertTrue(cvnfcCustomization.getDescription().equals(DESCRIPTION));
63 assertTrue(cvnfcCustomization.getModelCustomizationUUID().equals(MODEL_CUSTOMIZATION_UUID));
64 assertTrue(cvnfcCustomization.getModelInstanceName().equals(MODEL_INSTANCE_NAME));
65 assertTrue(cvnfcCustomization.getModelInvariantUUID().equals(MODEL_INVARIANT_UUID));
66 assertTrue(cvnfcCustomization.getModelName().equals(MODEL_NAME));
67 assertTrue(cvnfcCustomization.getModelUUID().equals(MODEL_UUID));
68 assertTrue(cvnfcCustomization.getModelVersion().equals(MODEL_VERSION));
69 assertTrue(cvnfcCustomization.getNfcFunction().equals(NFC_FUNCTION));
70 assertTrue(cvnfcCustomization.getNfcNamingCode().equals(NFC_NAMING_CODE));
71 assertTrue(cvnfcCustomization.getToscaNodeType().equals(TOSCA_NODE_TYPE));
72 assertTrue(cvnfcCustomization.getVfModuleCustomization().getModelCustomizationUUID()
73 .equals(MODEL_CUSTOMIZATION_UUID));
76 private VfModuleCustomization setupVfModuleCustomization() {
77 VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
78 vfModuleCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
79 return vfModuleCustomization;
83 private CvnfcConfigurationCustomization setupCvnfcConfigurationCustomization() {
84 CvnfcConfigurationCustomization cvnfcConfigurationCustomization = new CvnfcConfigurationCustomization();
85 cvnfcConfigurationCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
86 return cvnfcConfigurationCustomization;