2 * ============LICENSE_START=======================================================
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
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.openecomp.sdc.be.model;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition;
26 import java.util.LinkedList;
27 import java.util.List;
30 public class CapabilityDefinitionTest {
32 private CapabilityDefinition createTestSubject() {
33 return new CapabilityDefinition();
37 public void testCtor() throws Exception {
38 CapabilityDefinition other = new CapabilityDefinition();
39 new CapabilityDefinition(other);
40 other.setProperties(new LinkedList<>());
41 new CapabilityDefinition(other);
42 new CapabilityDefinition(new CapabilityDataDefinition());
46 public void testHashCode() throws Exception {
47 CapabilityDefinition testSubject;
51 testSubject = createTestSubject();
52 result = testSubject.hashCode();
57 public void testEquals() throws Exception {
58 CapabilityDefinition testSubject;
63 testSubject = createTestSubject();
64 result = testSubject.equals(obj);
65 result = testSubject.equals(new Object());
66 result = testSubject.equals(testSubject);
67 CapabilityDefinition createTestSubject = createTestSubject();
68 result = testSubject.equals(createTestSubject);
69 createTestSubject.setProperties(new LinkedList<>());
70 result = testSubject.equals(createTestSubject);
71 testSubject.setProperties(new LinkedList<>());
72 result = testSubject.equals(createTestSubject);
77 public void testToString() throws Exception {
78 CapabilityDefinition testSubject;
82 testSubject = createTestSubject();
83 result = testSubject.toString();
88 public void testGetProperties() throws Exception {
89 CapabilityDefinition testSubject;
90 List<ComponentInstanceProperty> result;
93 testSubject = createTestSubject();
94 result = testSubject.getProperties();
99 public void testSetProperties() throws Exception {
100 CapabilityDefinition testSubject;
101 List<ComponentInstanceProperty> properties = null;
104 testSubject = createTestSubject();
105 testSubject.setProperties(properties);