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.ArrayList;
25 import java.util.List;
26 import org.junit.Test;
28 public class VnfcCustomizationTest {
30 private static final String DESCRIPTION = "testDescription";
31 private static final String MODEL_CUSTOMIZATION_UUID = "testModelCustomizationUUID";
32 private static final String MODEL_INSTANCE_NAME = "testModelInstanceName";
33 private static final String MODEL_INVARIANT_UUID = "testModelInvariantUUID";
34 private static final String MODEL_NAME = "testModelName";
35 private static final String MODEL_UUID = "testModelUUID";
36 private static final String MODEL_VERSION = "testModelVersion";
37 private static final String TOSCA_NODE_TYPE = "testToscaNodeType";
40 public final void testVnfcCustomization() {
41 VnfcCustomization vnfcCustomization = new VnfcCustomization();
42 vnfcCustomization.setCvnfcCustomization(setupCvnfcCustomizationList());
43 vnfcCustomization.setDescription(DESCRIPTION);
44 vnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
45 vnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
46 vnfcCustomization.setModelInvariantUUID(MODEL_INVARIANT_UUID);
47 vnfcCustomization.setModelName(MODEL_NAME);
48 vnfcCustomization.setModelUUID(MODEL_UUID);
49 vnfcCustomization.setModelVersion(MODEL_VERSION);
50 vnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
52 assertTrue(vnfcCustomization.getDescription().equals(DESCRIPTION));
53 assertTrue(vnfcCustomization.getModelCustomizationUUID().equals(MODEL_CUSTOMIZATION_UUID));
54 assertTrue(vnfcCustomization.getModelInstanceName().equals(MODEL_INSTANCE_NAME));
55 assertTrue(vnfcCustomization.getModelInvariantUUID().equals(MODEL_INVARIANT_UUID));
56 assertTrue(vnfcCustomization.getModelName().equals(MODEL_NAME));
57 assertTrue(vnfcCustomization.getModelUUID().equals(MODEL_UUID));
58 assertTrue(vnfcCustomization.getModelVersion().equals(MODEL_VERSION));
59 assertTrue(vnfcCustomization.getToscaNodeType().equals(TOSCA_NODE_TYPE));
60 assertTrue(vnfcCustomization.getCvnfcCustomization().get(0).getModelCustomizationUUID()
61 .equals(MODEL_CUSTOMIZATION_UUID));
64 private List<CvnfcCustomization> setupCvnfcCustomizationList() {
65 CvnfcCustomization testCvnfcCustomization = new CvnfcCustomization();
66 testCvnfcCustomization.setModelCustomizationUUID(MODEL_CUSTOMIZATION_UUID);
67 testCvnfcCustomization.setDescription(DESCRIPTION);
68 testCvnfcCustomization.setModelVersion(MODEL_VERSION);
69 testCvnfcCustomization.setModelInstanceName(MODEL_INSTANCE_NAME);
70 testCvnfcCustomization.setToscaNodeType(TOSCA_NODE_TYPE);
71 List<CvnfcCustomization> testCvnfcCustomizationList = new ArrayList();
72 testCvnfcCustomizationList.add(testCvnfcCustomization);
73 return testCvnfcCustomizationList;