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.ComponentInstanceDataDefinition;
25 import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
27 import java.util.List;
30 public class ComponentInstanceTest {
32 private ComponentInstance createTestSubject() {
33 return new ComponentInstance();
37 public void testCtor() throws Exception {
38 new ComponentInstance(new ComponentInstanceDataDefinition());
42 public void testGetCapabilities() throws Exception {
43 ComponentInstance testSubject;
44 Map<String, List<CapabilityDefinition>> result;
47 testSubject = createTestSubject();
48 result = testSubject.getCapabilities();
52 public void testSetCapabilities() throws Exception {
53 ComponentInstance testSubject;
54 Map<String, List<CapabilityDefinition>> capabilities = null;
57 testSubject = createTestSubject();
58 testSubject.setCapabilities(capabilities);
62 public void testGetRequirements() throws Exception {
63 ComponentInstance testSubject;
64 Map<String, List<RequirementDefinition>> result;
67 testSubject = createTestSubject();
68 result = testSubject.getRequirements();
72 public void testSetRequirements() throws Exception {
73 ComponentInstance testSubject;
74 Map<String, List<RequirementDefinition>> requirements = null;
77 testSubject = createTestSubject();
78 testSubject.setRequirements(requirements);
82 public void testGetDeploymentArtifacts() throws Exception {
83 ComponentInstance testSubject;
84 Map<String, ArtifactDefinition> result;
87 testSubject = createTestSubject();
88 result = testSubject.getDeploymentArtifacts();
92 public void testSafeGetDeploymentArtifacts() throws Exception {
93 ComponentInstance testSubject;
94 Map<String, ArtifactDefinition> result;
97 testSubject = createTestSubject();
98 result = testSubject.safeGetDeploymentArtifacts();
102 public void testSafeGetInformationalArtifacts() throws Exception {
103 ComponentInstance testSubject;
104 Map<String, ArtifactDefinition> result;
107 testSubject = createTestSubject();
108 result = testSubject.safeGetInformationalArtifacts();
112 public void testSetDeploymentArtifacts() throws Exception {
113 ComponentInstance testSubject;
114 Map<String, ArtifactDefinition> deploymentArtifacts = null;
117 testSubject = createTestSubject();
118 testSubject.setDeploymentArtifacts(deploymentArtifacts);
122 public void testGetArtifacts() throws Exception {
123 ComponentInstance testSubject;
124 Map<String, ArtifactDefinition> result;
127 testSubject = createTestSubject();
128 result = testSubject.getArtifacts();
132 public void testSafeGetArtifacts() throws Exception {
133 ComponentInstance testSubject;
134 Map<String, ArtifactDefinition> result;
137 testSubject = createTestSubject();
138 result = testSubject.safeGetArtifacts();
142 public void testSetArtifacts() throws Exception {
143 ComponentInstance testSubject;
144 Map<String, ArtifactDefinition> artifacts = null;
147 testSubject = createTestSubject();
148 testSubject.setArtifacts(artifacts);
152 public void testGetGroupInstances() throws Exception {
153 ComponentInstance testSubject;
154 List<GroupInstance> result;
157 testSubject = createTestSubject();
158 result = testSubject.getGroupInstances();
162 public void testSetGroupInstances() throws Exception {
163 ComponentInstance testSubject;
164 List<GroupInstance> groupInstances = null;
167 testSubject = createTestSubject();
168 testSubject.setGroupInstances(groupInstances);
172 public void testGetActualComponentUid() throws Exception {
173 ComponentInstance testSubject;
177 testSubject = createTestSubject();
178 result = testSubject.getActualComponentUid();
182 public void testIsArtifactExists() throws Exception {
183 ComponentInstance testSubject;
184 ArtifactGroupTypeEnum groupType = null;
185 String artifactLabel = "";
189 testSubject = createTestSubject();
190 result = testSubject.isArtifactExists(groupType, artifactLabel);
191 testSubject = createTestSubject();
192 result = testSubject.isArtifactExists(ArtifactGroupTypeEnum.DEPLOYMENT, artifactLabel);