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;
25 import java.util.ArrayList;
26 import java.util.List;
28 import org.junit.Test;
30 public class VnfcCustomizationTest {
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";
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);
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));
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;