Support for defining attributes on a node_type
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / ComponentInstanceInterfaceBeanTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 Nokia. 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 package org.openecomp.sdc.be.model;
21
22 import static org.junit.Assert.assertEquals;
23
24 import org.junit.Test;
25 import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
26 import org.openecomp.sdc.be.datatypes.elements.InterfaceInstanceDataDefinition;
27
28 public class ComponentInstanceInterfaceBeanTest {
29
30     private static final String INTERFACE_ID = "interfaceId";
31     private static final InterfaceDataDefinition INTERFACE_DATA_DEFINITION = new InterfaceDataDefinition();
32     private static final InterfaceInstanceDataDefinition INTERFACE_INSTANCE_DATA_DEFINITION = new InterfaceInstanceDataDefinition();
33     private static final String ID = "ID";
34
35     @Test
36     public void verifyConstructors() {
37         INTERFACE_DATA_DEFINITION.setUniqueId(ID);
38         ComponentInstanceInterface componentInstanceInterface1 = new ComponentInstanceInterface(INTERFACE_ID,
39             INTERFACE_DATA_DEFINITION);
40         ComponentInstanceInterface componentInstanceInterface2 = new ComponentInstanceInterface(INTERFACE_ID,
41             INTERFACE_INSTANCE_DATA_DEFINITION);
42
43         assertEquals(componentInstanceInterface1.getInterfaceId(), INTERFACE_ID);
44         assertEquals(componentInstanceInterface2.getInterfaceId(), INTERFACE_ID);
45         assertEquals(componentInstanceInterface1.getUniqueId(), ID);
46         assertEquals(componentInstanceInterface2.getInterfaceInstanceDataDefinition(), INTERFACE_INSTANCE_DATA_DEFINITION);
47     }
48 }