Support for defining attributes on a node_type
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / CapabilityTypeDefinitionTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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  * Modifications copyright (c) 2019 Nokia
20  * ================================================================================
21  */
22
23 package org.openecomp.sdc.be.model;
24
25 import static org.junit.Assert.assertEquals;
26
27 import org.junit.Test;
28 import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition.OwnerType;
29 import org.openecomp.sdc.be.datatypes.elements.CapabilityTypeDataDefinition;
30 import org.openecomp.sdc.be.resources.data.CapabilityTypeData;
31
32 public class CapabilityTypeDefinitionTest {
33
34         private static final String OWNER_NAME = "ownerName";
35         private static final String NAME = "name";
36         private static final OwnerType RESOURCE = OwnerType.RESOURCE;
37         private static final String TYPE = "TYPE";
38         private static final String DESCRIPTION = "DESCRIPTION";
39         private static final String UNIQUE_ID = "UNIQUE_ID";
40
41         @Test
42         public void shouldCreateCapabilityTypeDefinitionFromCapabilityTypeData() {
43                 CapabilityTypeData capabilityTypeData = new CapabilityTypeData();
44                 CapabilityTypeDataDefinition capabilityTypeDataDefinition = new CapabilityTypeDataDefinition();
45                 capabilityTypeDataDefinition.setUniqueId(UNIQUE_ID);
46                 capabilityTypeDataDefinition.setType(TYPE);
47                 capabilityTypeData.setCapabilityTypeDataDefinition(capabilityTypeDataDefinition);
48                 CapabilityTypeDefinition capabilityTypeDefinition = new CapabilityTypeDefinition(capabilityTypeData);
49                 assertEquals(capabilityTypeDefinition.getType(), capabilityTypeData.getCapabilityTypeDataDefinition().getType());
50                 assertEquals(capabilityTypeDefinition.getUniqueId(), capabilityTypeData.getCapabilityTypeDataDefinition().getUniqueId());
51         }
52 }