1 package org.openecomp.sdc.be.components.impl;
4 import mockit.Deencapsulation;
5 import org.apache.commons.lang3.tuple.ImmutablePair;
6 import org.assertj.core.util.Lists;
7 import org.junit.Assert;
8 import org.junit.Before;
10 import org.mockito.Mockito;
11 import org.mockito.MockitoAnnotations;
12 import org.openecomp.sdc.be.components.validation.UserValidations;
13 import org.openecomp.sdc.be.dao.api.ActionStatus;
14 import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
15 import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition;
16 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
17 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
18 import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
19 import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition;
20 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
21 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
22 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
23 import org.openecomp.sdc.be.impl.ComponentsUtils;
24 import org.openecomp.sdc.be.impl.ServletUtils;
25 import org.openecomp.sdc.be.info.CreateAndAssotiateInfo;
26 import org.openecomp.sdc.be.model.CapabilityDefinition;
27 import org.openecomp.sdc.be.model.CapabilityRequirementRelationship;
28 import org.openecomp.sdc.be.model.Component;
29 import org.openecomp.sdc.be.model.ComponentInstance;
30 import org.openecomp.sdc.be.model.ComponentInstanceInput;
31 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
32 import org.openecomp.sdc.be.model.ComponentParametersView;
33 import org.openecomp.sdc.be.model.RelationshipImpl;
34 import org.openecomp.sdc.be.model.RelationshipInfo;
35 import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
36 import org.openecomp.sdc.be.model.RequirementDefinition;
37 import org.openecomp.sdc.be.model.Resource;
38 import org.openecomp.sdc.be.model.Service;
39 import org.openecomp.sdc.be.model.User;
40 import org.openecomp.sdc.be.model.jsontitan.operations.ForwardingPathOperation;
41 import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
42 import org.openecomp.sdc.be.model.operations.api.IComponentInstanceOperation;
43 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
44 import org.openecomp.sdc.be.user.UserBusinessLogic;
45 import org.openecomp.sdc.exception.ResponseFormat;
47 import java.util.ArrayList;
48 import java.util.Arrays;
49 import java.util.HashMap;
50 import java.util.HashSet;
51 import java.util.List;
54 import java.util.function.BiPredicate;
56 import static org.junit.Assert.assertTrue;
57 import static org.mockito.ArgumentMatchers.any;
58 import static org.mockito.ArgumentMatchers.anySet;
59 import static org.mockito.ArgumentMatchers.anyString;
60 import static org.mockito.ArgumentMatchers.eq;
61 import static org.mockito.Mockito.when;
64 * The test suite designed for test functionality of
65 * ComponentInstanceBusinessLogic class
67 public class ComponentInstanceBusinessLogicTest {
69 private final static String USER_ID = "jh0003";
70 private final static String COMPONENT_ID = "componentId";
71 private final static String TO_INSTANCE_ID = "toInstanceId";
72 private final static String FROM_INSTANCE_ID = "fromInstanceId";
73 private final static String RELATION_ID = "relationId";
74 private final static String CAPABILITY_OWNER_ID = "capabilityOwnerId";
75 private final static String CAPABILITY_UID = "capabilityUid";
76 private final static String CAPABILITY_NAME = "capabilityName";
77 private final static String REQUIREMENT_OWNER_ID = "requirementOwnerId";
78 private final static String REQUIREMENT_UID = "requirementUid";
79 private final static String REQUIREMENT_NAME = "requirementName";
80 private final static String RELATIONSHIP_TYPE = "relationshipType";
82 private static ComponentsUtils componentsUtils;
83 private static ServletUtils servletUtils;
84 private static ResponseFormat responseFormat;
85 private static ToscaOperationFacade toscaOperationFacade;
86 private static IComponentInstanceOperation componentInstanceOperation;
87 private static UserBusinessLogic userAdmin;
89 private static ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
90 private static ForwardingPathOperation forwardingPathOperation;
91 private static User user;
92 private static UserValidations userValidations;
93 private static Component service;
94 private static Component resource;
95 private static ComponentInstance toInstance;
96 private static ComponentInstance fromInstance;
97 private static CapabilityDataDefinition capability;
98 private static RequirementDataDefinition requirement;
99 private static RequirementCapabilityRelDef relation;
100 private static BaseBusinessLogic baseBusinessLogic;
101 private static ArtifactsBusinessLogic artifactsBusinessLogic;
102 private static ToscaDataDefinition toscaDataDefinition;
110 MockitoAnnotations.initMocks(this);
114 public void testGetRelationByIdSuccess() {
115 getServiceRelationByIdSuccess(service);
116 getServiceRelationByIdSuccess(resource);
120 public void testGetRelationByIdUserValidationFailure() {
121 getServiceRelationByIdUserValidationFailure(service);
122 getServiceRelationByIdUserValidationFailure(resource);
126 public void testGetRelationByIdComponentNotFoundFailure() {
127 getRelationByIdComponentNotFoundFailure(service);
128 getRelationByIdComponentNotFoundFailure(resource);
133 public void testForwardingPathOnVersionChange() {
134 getforwardingPathOnVersionChange();
137 private void getforwardingPathOnVersionChange() {
138 String containerComponentParam = "services";
139 String containerComponentID = "121-cont";
140 String componentInstanceID = "121-cont-1-comp";
141 Service component = new Service();
142 Map<String, ForwardingPathDataDefinition> forwardingPaths = generateForwardingPath(componentInstanceID);
144 // Add existing componentInstance to component
145 List<ComponentInstance> componentInstanceList = new ArrayList<>();
146 ComponentInstance oldComponentInstance = new ComponentInstance();
147 oldComponentInstance.setName("OLD_COMP_INSTANCE");
148 oldComponentInstance.setUniqueId(componentInstanceID);
149 oldComponentInstance.setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_UID, "1-comp");
150 componentInstanceList.add(oldComponentInstance);
151 component.setComponentInstances(componentInstanceList);
152 component.setForwardingPaths(forwardingPaths);
154 List<ComponentInstance> componentInstanceListNew = new ArrayList<>();
155 ComponentInstance newComponentInstance = new ComponentInstance();
156 String new_Comp_UID = "2-comp";
157 newComponentInstance.setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_UID, new_Comp_UID);
158 newComponentInstance.setUniqueId(new_Comp_UID);
159 componentInstanceListNew.add(newComponentInstance);
160 Component component2 = new Service();
161 component2.setComponentInstances(componentInstanceListNew);
163 // Mock for getting component
164 when(toscaOperationFacade.getToscaElement(eq(containerComponentID), any(ComponentParametersView.class)))
165 .thenReturn(Either.left(component));
166 when(toscaOperationFacade.validateComponentExists(any(String.class))).thenReturn(Either.left(Boolean.TRUE));
167 // Mock for getting component for componentInstance
168 when(toscaOperationFacade.getToscaFullElement(eq("1-comp"))).thenReturn(Either.left(component));
169 when(toscaOperationFacade.getToscaFullElement(eq(new_Comp_UID))).thenReturn(Either.left(component2));
171 Either<Set<String>, ResponseFormat> resultOp = componentInstanceBusinessLogic.forwardingPathOnVersionChange(
172 containerComponentParam, containerComponentID, componentInstanceID, newComponentInstance);
173 Assert.assertEquals(1, resultOp.left().value().size());
174 Assert.assertEquals("FP-ID-1", resultOp.left().value().iterator().next());
179 public void testDeleteForwardingPathsWhenComponentinstanceDeleted(){
181 ComponentTypeEnum containerComponentType = ComponentTypeEnum.findByParamName("services");
182 String containerComponentID = "Service-comp";
183 String componentInstanceID = "NodeA1";
184 Service component = new Service();
185 component.setComponentInstances(Arrays.asList(createComponentIstance("NodeA2"),createComponentIstance("NodeB2"),
186 createComponentIstance(componentInstanceID)));
188 component.addForwardingPath(createPath("path1", componentInstanceID, "NodeB1", "1"));
189 component.addForwardingPath(createPath("Path2", "NodeA2","NodeB2", "2"));
190 when(toscaOperationFacade.getToscaElement(eq(containerComponentID),any(ComponentParametersView.class))).thenReturn(Either.left(component));
191 when(toscaOperationFacade.getToscaElement(eq(containerComponentID))).thenReturn(Either.left(component));
192 when(forwardingPathOperation.deleteForwardingPath(any(Service.class), anySet())).thenReturn(Either.left(new HashSet<>()));
193 final ComponentInstance ci = new ComponentInstance();
194 ci.setName(componentInstanceID);
195 Either<ComponentInstance, ResponseFormat> responseFormatEither = componentInstanceBusinessLogic.deleteForwardingPathsRelatedTobeDeletedComponentInstance(
196 containerComponentID, containerComponentType, Either.left(ci));
197 Assert.assertTrue(responseFormatEither.isLeft());
201 private ComponentInstance createComponentIstance(String path1) {
202 ComponentInstance componentInstance = new ComponentInstance();
203 componentInstance.setName(path1);
204 return componentInstance;
208 public void testDeleteForwardingPathsWhenErrorInComponentinstanceDelete() {
210 ComponentTypeEnum containerComponentType = ComponentTypeEnum.findByParamName("services");
211 String containerComponentID = "Service-comp";
212 Service component = new Service();
214 component.addForwardingPath(createPath("path1", "NodeA1", "NodeB1", "1"));
215 component.addForwardingPath(createPath("Path2", "NodeA2", "NodeB2", "2"));
216 when(toscaOperationFacade.getToscaElement(eq(containerComponentID), any(ComponentParametersView.class)))
217 .thenReturn(Either.left(component));
218 when(toscaOperationFacade.getToscaElement(eq(containerComponentID))).thenReturn(Either.left(component));
219 when(forwardingPathOperation.deleteForwardingPath(any(Service.class), anySet()))
220 .thenReturn(Either.left(new HashSet<>()));
221 Either<ComponentInstance, ResponseFormat> responseFormatEither = componentInstanceBusinessLogic
222 .deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentID,
223 containerComponentType, Either.right(new ResponseFormat()));
224 Assert.assertTrue(responseFormatEither.isRight());
228 private ForwardingPathDataDefinition createPath(String pathName, String fromNode, String toNode, String uniqueId) {
229 ForwardingPathDataDefinition forwardingPath = new ForwardingPathDataDefinition(pathName);
230 forwardingPath.setProtocol("protocol");
231 forwardingPath.setDestinationPortNumber("port");
232 forwardingPath.setUniqueId(uniqueId);
233 ListDataDefinition<ForwardingPathElementDataDefinition> forwardingPathElementListDataDefinition = new ListDataDefinition<>();
234 forwardingPathElementListDataDefinition.add(new ForwardingPathElementDataDefinition(fromNode, toNode,
235 "nodeAcpType", "nodeBcpType", "nodeDcpName", "nodeBcpName"));
236 forwardingPath.setPathElements(forwardingPathElementListDataDefinition);
238 return forwardingPath;
241 private Map<String, ForwardingPathDataDefinition> generateForwardingPath(String componentInstanceID) {
242 ForwardingPathDataDefinition forwardingPath = new ForwardingPathDataDefinition("fpName");
243 String protocol = "protocol";
244 forwardingPath.setProtocol(protocol);
245 forwardingPath.setDestinationPortNumber("DestinationPortNumber");
246 forwardingPath.setUniqueId("FP-ID-1");
247 ListDataDefinition<ForwardingPathElementDataDefinition> forwardingPathElementListDataDefinition = new ListDataDefinition<>();
248 forwardingPathElementListDataDefinition.add(new ForwardingPathElementDataDefinition(componentInstanceID,
249 "nodeB", "nodeA_FORWARDER_CAPABILITY", "nodeBcpType", "nodeDcpName", "nodeBcpName"));
250 forwardingPath.setPathElements(forwardingPathElementListDataDefinition);
251 Map<String, ForwardingPathDataDefinition> forwardingPaths = new HashMap<>();
252 forwardingPaths.put("1122", forwardingPath);
253 return forwardingPaths;
256 @SuppressWarnings("unchecked")
257 private void getServiceRelationByIdSuccess(Component component) {
258 Either<User, ActionStatus> eitherCreator = Either.left(user);
259 when(userAdmin.getUser(eq(USER_ID), eq(false))).thenReturn(eitherCreator);
260 Either<Component, StorageOperationStatus> getComponentRes = Either.left(component);
261 when(toscaOperationFacade.getToscaElement(eq(COMPONENT_ID), any(ComponentParametersView.class)))
262 .thenReturn(getComponentRes);
264 Either<RequirementDataDefinition, StorageOperationStatus> getfulfilledRequirementRes = Either.left(requirement);
265 when(toscaOperationFacade.getFulfilledRequirementByRelation(eq(COMPONENT_ID), eq(FROM_INSTANCE_ID),
266 eq(relation), any(BiPredicate.class))).thenReturn(getfulfilledRequirementRes);
268 Either<CapabilityDataDefinition, StorageOperationStatus> getfulfilledCapabilityRes = Either.left(capability);
269 when(toscaOperationFacade.getFulfilledCapabilityByRelation(eq(COMPONENT_ID), eq(FROM_INSTANCE_ID), eq(relation),
270 any(BiPredicate.class))).thenReturn(getfulfilledCapabilityRes);
272 Either<RequirementCapabilityRelDef, ResponseFormat> response = componentInstanceBusinessLogic
273 .getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType());
274 assertTrue(response.isLeft());
277 private void getServiceRelationByIdUserValidationFailure(Component component) {
278 when(userValidations.validateUserExists(eq(USER_ID), eq("get relation by Id"), eq(false)))
279 .thenReturn(Either.right(new ResponseFormat(404)));
280 Either<RequirementCapabilityRelDef, ResponseFormat> response = componentInstanceBusinessLogic
281 .getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType());
282 assertTrue(response.isRight());
285 private void getRelationByIdComponentNotFoundFailure(Component component) {
286 Either<User, ActionStatus> eitherCreator = Either.left(user);
287 when(userAdmin.getUser(eq(USER_ID), eq(false))).thenReturn(eitherCreator);
288 Either<Component, StorageOperationStatus> getComponentRes = Either.right(StorageOperationStatus.NOT_FOUND);
289 when(toscaOperationFacade.getToscaElement(eq(COMPONENT_ID), any(ComponentParametersView.class)))
290 .thenReturn(getComponentRes);
292 Either<RequirementCapabilityRelDef, ResponseFormat> response = componentInstanceBusinessLogic
293 .getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType());
294 assertTrue(response.isRight());
297 private static void createMocks() {
298 componentsUtils = Mockito.mock(ComponentsUtils.class);
299 servletUtils = Mockito.mock(ServletUtils.class);
300 responseFormat = Mockito.mock(ResponseFormat.class);
301 toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class);
302 userAdmin = Mockito.mock(UserBusinessLogic.class);
303 user = Mockito.mock(User.class);
304 baseBusinessLogic = Mockito.mock(BaseBusinessLogic.class);
305 userValidations = Mockito.mock(UserValidations.class);
306 forwardingPathOperation = Mockito.mock(ForwardingPathOperation.class);
307 componentInstanceOperation = Mockito.mock(IComponentInstanceOperation.class);
308 artifactsBusinessLogic = Mockito.mock(ArtifactsBusinessLogic.class);
309 toscaDataDefinition = Mockito.mock(ToscaDataDefinition.class);
312 private static void setMocks() {
313 componentInstanceBusinessLogic = new ComponentInstanceBusinessLogic();
314 componentInstanceBusinessLogic.setToscaOperationFacade(toscaOperationFacade);
315 componentInstanceBusinessLogic.setUserAdmin(userAdmin);
316 componentInstanceBusinessLogic.setComponentsUtils(componentsUtils);
317 componentInstanceBusinessLogic.setUserValidations(userValidations);
318 componentInstanceBusinessLogic.setForwardingPathOperation(forwardingPathOperation);
321 private static void stubMethods() {
322 when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils);
323 when(userValidations.validateUserExists(eq(USER_ID), eq("get relation by Id"), eq(false)))
324 .thenReturn(Either.left(user));
325 when(componentsUtils.getResponseFormat(eq(ActionStatus.RELATION_NOT_FOUND), eq(RELATION_ID), eq(COMPONENT_ID)))
326 .thenReturn(responseFormat);
327 Either<User, ActionStatus> eitherGetUser = Either.left(user);
328 when(userAdmin.getUser("jh0003", false)).thenReturn(eitherGetUser);
329 when(userValidations.validateUserExists(eq(user.getUserId()), anyString(), eq(false)))
330 .thenReturn(Either.left(user));
333 private static void createComponents() {
340 private static Component createResource() {
341 resource = new Resource();
342 resource.setUniqueId(COMPONENT_ID);
343 resource.setComponentInstancesRelations(Lists.newArrayList(relation));
344 resource.setComponentInstances(Lists.newArrayList(toInstance, fromInstance));
345 resource.setCapabilities(toInstance.getCapabilities());
346 resource.setRequirements(fromInstance.getRequirements());
347 resource.setComponentType(ComponentTypeEnum.RESOURCE);
351 private static Component createService() {
352 service = new Service();
353 service.setUniqueId(COMPONENT_ID);
354 service.setComponentInstancesRelations(Lists.newArrayList(relation));
355 service.setComponentInstances(Lists.newArrayList(toInstance, fromInstance));
356 service.setCapabilities(toInstance.getCapabilities());
357 service.setRequirements(fromInstance.getRequirements());
358 service.setComponentType(ComponentTypeEnum.SERVICE);
362 private static ComponentInstance createInstances() {
363 toInstance = new ComponentInstance();
364 toInstance.setUniqueId(TO_INSTANCE_ID);
365 toInstance.setComponentUid("uuuiiid");
366 toInstance.setName("tests");
368 fromInstance = new ComponentInstance();
369 fromInstance.setUniqueId(FROM_INSTANCE_ID);
371 capability = new CapabilityDataDefinition();
372 capability.setOwnerId(CAPABILITY_OWNER_ID);
373 capability.setUniqueId(CAPABILITY_UID);
374 capability.setName(CAPABILITY_NAME);
376 Map<String, List<CapabilityDefinition>> capabilities = new HashMap<>();
377 capabilities.put(capability.getName(), Lists.newArrayList(new CapabilityDefinition(capability)));
379 requirement = new RequirementDataDefinition();
380 requirement.setOwnerId(REQUIREMENT_OWNER_ID);
381 requirement.setUniqueId(REQUIREMENT_UID);
382 requirement.setName(REQUIREMENT_NAME);
383 requirement.setRelationship(RELATIONSHIP_TYPE);
385 Map<String, List<RequirementDefinition>> requirements = new HashMap<>();
386 requirements.put(requirement.getCapability(), Lists.newArrayList(new RequirementDefinition(requirement)));
388 toInstance.setCapabilities(capabilities);
389 fromInstance.setRequirements(requirements);
393 private static void createRelation() {
395 relation = new RequirementCapabilityRelDef();
396 CapabilityRequirementRelationship relationship = new CapabilityRequirementRelationship();
397 RelationshipInfo relationInfo = new RelationshipInfo();
398 relationInfo.setId(RELATION_ID);
399 relationship.setRelation(relationInfo);
401 relation.setRelationships(Lists.newArrayList(relationship));
402 relation.setToNode(TO_INSTANCE_ID);
403 relation.setFromNode(FROM_INSTANCE_ID);
405 relationInfo.setCapabilityOwnerId(CAPABILITY_OWNER_ID);
406 relationInfo.setCapabilityUid(CAPABILITY_UID);
407 relationInfo.setCapability(CAPABILITY_NAME);
408 relationInfo.setRequirementOwnerId(REQUIREMENT_OWNER_ID);
409 relationInfo.setRequirementUid(REQUIREMENT_UID);
410 relationInfo.setRequirement(REQUIREMENT_NAME);
411 RelationshipImpl relationshipImpl = new RelationshipImpl();
412 relationshipImpl.setType(RELATIONSHIP_TYPE);
413 relationInfo.setRelationships(relationshipImpl);
416 ///////////////////////////////////////////////////////////////////////////////
417 /////////////////////////////new test//////////////////////////////////////////
418 ///////////////////////////////////////////////////////////////////////////////
421 private ComponentInstanceBusinessLogic createTestSubject() {
422 return componentInstanceBusinessLogic;
430 public void testChangeServiceProxyVersion() throws Exception {
431 ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
432 String containerComponentType = "";
433 String containerComponentId = "";
434 String serviceProxyId = "";
435 String userId = user.getUserId();
436 Either<ComponentInstance, ResponseFormat> result;
439 componentInstanceBusinessLogic = createTestSubject();
440 result = componentInstanceBusinessLogic.changeServiceProxyVersion(containerComponentType, containerComponentId, serviceProxyId,
451 public void testCreateServiceProxy() throws Exception {
452 ComponentInstanceBusinessLogic testSubject;
453 String containerComponentType = "";
454 String containerComponentId = "";
455 String userId = user.getUserId();
456 ComponentInstance componentInstance = createInstances();
457 Either<ComponentInstance, ResponseFormat> result;
460 testSubject = createTestSubject();
461 result = testSubject.createServiceProxy(containerComponentType, containerComponentId, userId,
470 public void testDeleteForwardingPathsRelatedTobeDeletedComponentInstance() throws Exception {
471 ComponentInstanceBusinessLogic testSubject;
472 String containerComponentId = "";
473 String componentInstanceId = "";
474 ComponentTypeEnum containerComponentType = ComponentTypeEnum.RESOURCE;
475 Either<ComponentInstance, ResponseFormat> resultOp = null;
476 Either<ComponentInstance, ResponseFormat> result;
479 testSubject = createTestSubject();
480 result = testSubject.deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentId,
481 containerComponentType, resultOp);
486 public void testDeleteServiceProxy() throws Exception {
487 ComponentInstanceBusinessLogic testSubject;
488 String containerComponentType = "";
489 String containerComponentId = "";
490 String serviceProxyId = "";
491 String userId = user.getUserId();
492 Either<ComponentInstance, ResponseFormat> result;
495 testSubject = createTestSubject();
496 result = testSubject.deleteServiceProxy(containerComponentType, containerComponentId, serviceProxyId, userId);
505 public void testGetComponentInstanceInputsByInputId() throws Exception {
506 ComponentInstanceBusinessLogic testSubject;
507 Component component = new Service();
509 List<ComponentInstanceInput> result;
512 testSubject = createTestSubject();
513 result = testSubject.getComponentInstanceInputsByInputId(component, inputId);
519 public void testGetComponentInstancePropertiesByInputId() throws Exception {
520 ComponentInstanceBusinessLogic testSubject;
521 Component component = new Service();
523 List<ComponentInstanceProperty> result;
526 testSubject = createTestSubject();
527 result = testSubject.getComponentInstancePropertiesByInputId(component, inputId);
532 public void testGetRelationById() throws Exception {
533 ComponentInstanceBusinessLogic testSubject;
534 String componentId = "";
535 String relationId = "";
536 String userId = user.getUserId();
537 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE_INSTANCE;
538 Either<RequirementCapabilityRelDef, ResponseFormat> result;
541 testSubject = createTestSubject();
542 result = testSubject.getRelationById(componentId, relationId, userId, componentTypeEnum);
550 public void testCreateComponentInstance_1() throws Exception {
551 ComponentInstanceBusinessLogic testSubject;String containerComponentParam = "";
552 String containerComponentId = "";
553 String userId = user.getUserId();
554 ComponentInstance resourceInstance = null;
555 boolean inTransaction = false;
556 boolean needLock = false;
557 Either<ComponentInstance,ResponseFormat> result;
560 testSubject=createTestSubject();result=testSubject.createComponentInstance(containerComponentParam, containerComponentId, userId, resourceInstance, inTransaction, needLock);
568 public void testCreateAndAssociateRIToRI() throws Exception {
569 ComponentInstanceBusinessLogic testSubject;
571 String containerComponentParam = "";
572 String containerComponentId = "";
573 String userId = user.getUserId();
574 CreateAndAssotiateInfo createAndAssotiateInfo = new CreateAndAssotiateInfo(null, null);
575 Either<CreateAndAssotiateInfo,ResponseFormat> result;
578 testSubject=createTestSubject();result=testSubject.createAndAssociateRIToRI(containerComponentParam, containerComponentId, userId, createAndAssotiateInfo);
582 public void testGetOriginComponentFromComponentInstance_1() throws Exception {
583 ComponentInstanceBusinessLogic testSubject;
584 Component compoent = createResource();
585 String componentInstanceName = "";
586 String origComponetId = compoent.getUniqueId();
587 Either<Component, StorageOperationStatus> oldResourceRes = Either.left(compoent);
588 when(toscaOperationFacade.getToscaFullElement(compoent.getUniqueId())).thenReturn(oldResourceRes);
589 Either<Component,ResponseFormat> result;
592 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "getOriginComponentFromComponentInstance", new Object[]{componentInstanceName, origComponetId});
597 public void testCreateComponentInstanceOnGraph() throws Exception {
598 ComponentInstanceBusinessLogic testSubject;
599 Component containerComponent = createResource();
600 Component originComponent = null;
601 ComponentInstance componentInstance = createInstances();
602 Either<ComponentInstance,ResponseFormat> result;
604 Either<ImmutablePair<Component, String>, StorageOperationStatus> result2 = Either.right(StorageOperationStatus.ARTIFACT_NOT_FOUND);
605 when(toscaOperationFacade.addComponentInstanceToTopologyTemplate(containerComponent, containerComponent,componentInstance, false, user)).thenReturn(result2);
608 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "createComponentInstanceOnGraph", new Object[]{containerComponent, containerComponent, componentInstance, user});
612 public void testCreateComponentInstanceOnGraph2() throws Exception {
613 ComponentInstanceBusinessLogic testSubject;
614 Component containerComponent = createResource();
615 containerComponent.setName("name");
616 ComponentInstance componentInstance = createInstances();
617 Either<ComponentInstance,ResponseFormat> result;
618 ImmutablePair<Component, String> pair = new ImmutablePair<>(containerComponent,"");
623 Either<ImmutablePair<Component, String>, StorageOperationStatus> result2 = Either.left(pair);
624 when(toscaOperationFacade.addComponentInstanceToTopologyTemplate(containerComponent, containerComponent,componentInstance, false, user)).thenReturn(result2);
627 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "createComponentInstanceOnGraph", new Object[]{containerComponent, containerComponent, componentInstance, user});
631 public void testUpdateComponentInstanceMetadata() throws Exception {
632 ComponentInstanceBusinessLogic testSubject;
633 String containerComponentParam = "";
634 String containerComponentId = "";
635 String componentInstanceId = "";
636 String userId = user.getUserId();
637 ComponentInstance componentInstance = createInstances();
638 Either<ComponentInstance,ResponseFormat> result;
641 testSubject=createTestSubject();result=testSubject.updateComponentInstanceMetadata(containerComponentParam, containerComponentId, componentInstanceId, userId, componentInstance);
646 public void testUpdateComponentInstanceMetadata_1() throws Exception {
647 ComponentInstanceBusinessLogic testSubject;String containerComponentParam = "";
648 String containerComponentId = "";
649 String componentInstanceId = "";
650 String userId = user.getUserId();
651 ComponentInstance componentInstance = createInstances();
652 boolean inTransaction = false;
653 boolean needLock = false;
654 boolean createNewTransaction = false;
655 Either<ComponentInstance,ResponseFormat> result;
658 testSubject=createTestSubject();result=testSubject.updateComponentInstanceMetadata(containerComponentParam, containerComponentId, componentInstanceId, userId, componentInstance, inTransaction, needLock, createNewTransaction);
666 public void testValidateParent() throws Exception {
667 ComponentInstanceBusinessLogic testSubject;
668 Component containerComponent = createResource();
669 String nodeTemplateId = "";
673 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "validateParent", new Object[]{containerComponent, nodeTemplateId});
678 public void testGetComponentType() throws Exception {
679 ComponentInstanceBusinessLogic testSubject;
680 ComponentTypeEnum containerComponentType = ComponentTypeEnum.RESOURCE;
681 ComponentTypeEnum result;
684 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "getComponentType", new Object[]{ComponentTypeEnum.class});
690 public void testGetNewGroupName() throws Exception {
691 ComponentInstanceBusinessLogic testSubject;String oldPrefix = "";
692 String newNormailzedPrefix = "";
693 String qualifiedGroupInstanceName = "";
697 testSubject=createTestSubject();
698 result=Deencapsulation.invoke(testSubject, "getNewGroupName", new Object[]{oldPrefix, newNormailzedPrefix, qualifiedGroupInstanceName});
703 public void testUpdateComponentInstanceMetadata_3() throws Exception {
704 ComponentInstanceBusinessLogic testSubject;
705 ComponentInstance oldComponentInstance = createInstances();
706 ComponentInstance newComponentInstance = null;
707 ComponentInstance result;
710 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "updateComponentInstanceMetadata", new Object[]{oldComponentInstance, oldComponentInstance});
715 public void testDeleteComponentInstance() throws Exception {
716 ComponentInstanceBusinessLogic testSubject;String containerComponentParam = "";
717 String containerComponentId = "";
718 String componentInstanceId = "";
719 String userId = user.getUserId();
720 Either<ComponentInstance,ResponseFormat> result;
723 testSubject=createTestSubject();result=testSubject.deleteComponentInstance(containerComponentParam, containerComponentId, componentInstanceId, userId);
728 public void testDeleteForwardingPaths() throws Exception {
729 ComponentInstanceBusinessLogic testSubject;
730 Component service = createService();
731 String serviceId = service.getUniqueId();
732 List<String> pathIdsToDelete = new ArrayList<>();
733 Either<Set<String>,ResponseFormat> result;
735 // Either<Service, StorageOperationStatus> storageStatus = toscaOperationFacade.getToscaElement(serviceId);
736 when(toscaOperationFacade.getToscaElement(serviceId)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
739 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "deleteForwardingPaths", new Object[]{serviceId, pathIdsToDelete});
744 public void testAssociateRIToRIOnGraph() throws Exception {
745 ComponentInstanceBusinessLogic testSubject;
746 Component containerComponent = createResource();
747 RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
748 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
749 boolean inTransaction = false;
750 Either<RequirementCapabilityRelDef,ResponseFormat> result;
754 Either<RequirementCapabilityRelDef, StorageOperationStatus> getResourceResult = Either.left(requirementDef);
755 when(toscaOperationFacade.associateResourceInstances(containerComponent.getUniqueId(), requirementDef)).thenReturn(getResourceResult);
758 testSubject=createTestSubject();result=testSubject.associateRIToRIOnGraph(containerComponent, requirementDef, componentTypeEnum, inTransaction);
764 public void testFindRelation() throws Exception {
765 ComponentInstanceBusinessLogic testSubject;
766 String relationId = "";
767 List<RequirementCapabilityRelDef> requirementCapabilityRelations = new ArrayList<>();
768 RequirementCapabilityRelDef result;
771 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "findRelation", new Object[]{relationId, requirementCapabilityRelations});
776 public void testIsNetworkRoleServiceProperty() throws Exception {
777 ComponentInstanceBusinessLogic testSubject;
778 ComponentInstanceProperty property = new ComponentInstanceProperty();
779 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
783 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "isNetworkRoleServiceProperty", new Object[]{property, componentTypeEnum});
788 public void testConcatServiceNameToVLINetworkRolePropertiesValues() throws Exception {
789 ComponentInstanceBusinessLogic testSubject;
790 ToscaOperationFacade toscaOperationFacade = new ToscaOperationFacade();
791 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
792 String componentId = "";
793 String resourceInstanceId = "";
794 List<ComponentInstanceProperty> properties = new ArrayList<>();
795 StorageOperationStatus result;
798 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "concatServiceNameToVLINetworkRolePropertiesValues", new Object[]{toscaOperationFacade, componentTypeEnum, componentId, resourceInstanceId, properties});
803 public void testCreateOrUpdatePropertiesValues() throws Exception {
804 ComponentInstanceBusinessLogic testSubject;
805 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
806 Component component = createResource();
807 String componentId = component.getUniqueId();
808 String resourceInstanceId = "";
809 List<ComponentInstanceProperty> properties = new ArrayList<>();
810 String userId = user.getUserId();
811 Either<List<ComponentInstanceProperty>,ResponseFormat> result;
813 // Either<Component, StorageOperationStatus> getResourceResult = toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseAll);
814 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseAll)).thenReturn(Either.left(component));
817 testSubject=createTestSubject();
818 result=testSubject.createOrUpdatePropertiesValues(componentTypeEnum, componentId, resourceInstanceId, properties, userId);
820 componentTypeEnum =null;
821 result=testSubject.createOrUpdatePropertiesValues(componentTypeEnum, componentId, resourceInstanceId, properties, userId);
823 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseAll)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
824 result=testSubject.createOrUpdatePropertiesValues(componentTypeEnum, componentId, resourceInstanceId, properties, userId);
830 public void testUpdateCapabilityPropertyOnContainerComponent() throws Exception {
831 ComponentInstanceBusinessLogic testSubject;
832 ComponentInstanceProperty property = new ComponentInstanceProperty();
833 String newValue = "";
834 Component containerComponent = createResource();
835 ComponentInstance foundResourceInstance = createInstances();
836 String capabilityType = "";
837 String capabilityName = "";
838 ResponseFormat result;
841 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "updateCapabilityPropertyOnContainerComponent", new Object[]{property, newValue, containerComponent, foundResourceInstance, capabilityType, capabilityName});
847 public void testCreateOrUpdateInstanceInputValues() throws Exception {
848 ComponentInstanceBusinessLogic testSubject;
849 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
850 Component resource = createResource();
851 String componentId = resource.getUniqueId();
852 String resourceInstanceId = "";
853 List<ComponentInstanceInput> inputs = new ArrayList<>();
854 String userId = user.getUserId();
855 Either<List<ComponentInstanceInput>,ResponseFormat> result;
857 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseAll)).thenReturn(Either.left(resource));
860 testSubject=createTestSubject();
861 result=testSubject.createOrUpdateInstanceInputValues(componentTypeEnum, componentId, resourceInstanceId, inputs, userId);
862 componentTypeEnum =null;
863 result=testSubject.createOrUpdateInstanceInputValues(componentTypeEnum, componentId, resourceInstanceId, inputs, userId);
866 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseAll)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
867 result=testSubject.createOrUpdateInstanceInputValues(componentTypeEnum, componentId, resourceInstanceId, inputs, userId);
873 public void testCreateOrUpdateGroupInstancePropertyValue() throws Exception {
874 ComponentInstanceBusinessLogic testSubject;
875 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
876 Component resource = createResource();
877 String componentId = resource.getUniqueId();
878 String resourceInstanceId = "";
879 String groupInstanceId = "";
880 ComponentInstanceProperty property = new ComponentInstanceProperty();
881 String userId = user.getUserId();
882 Either<ComponentInstanceProperty,ResponseFormat> result;
885 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseMetadata)).thenReturn(Either.left(resource));
888 testSubject=createTestSubject();
889 result=testSubject.createOrUpdateGroupInstancePropertyValue(componentTypeEnum, componentId, resourceInstanceId, groupInstanceId, property, userId);
890 componentTypeEnum = null;
891 result=testSubject.createOrUpdateGroupInstancePropertyValue(componentTypeEnum, componentId, resourceInstanceId, groupInstanceId, property, userId);
893 when(toscaOperationFacade.getToscaElement(componentId, JsonParseFlagEnum.ParseMetadata)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
894 result=testSubject.createOrUpdateGroupInstancePropertyValue(componentTypeEnum, componentId, resourceInstanceId, groupInstanceId, property, userId);
899 public void testCreateOrUpdateInputValue() throws Exception {
900 ComponentInstanceBusinessLogic testSubject;
901 Component component = createResource();
902 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
903 String componentId = component.getUniqueId();
904 String resourceInstanceId = component.getUniqueId();
905 ComponentInstanceInput inputProperty = new ComponentInstanceInput();
906 String userId = user.getUserId();
907 Either<ComponentInstanceInput,ResponseFormat> result;
910 Either<Component, StorageOperationStatus> getResourceResult = Either.left(component);
911 when(toscaOperationFacade.getToscaElement(component.getUniqueId(), JsonParseFlagEnum.ParseMetadata)).thenReturn(getResourceResult);
914 testSubject=createTestSubject();
915 result=testSubject.createOrUpdateInputValue(componentTypeEnum, componentId, resourceInstanceId, inputProperty, userId);
917 componentTypeEnum = null;
918 result=testSubject.createOrUpdateInputValue(componentTypeEnum, componentId, resourceInstanceId, inputProperty, userId);
920 when(toscaOperationFacade.getToscaElement(component.getUniqueId(), JsonParseFlagEnum.ParseMetadata)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
921 result=testSubject.createOrUpdateInputValue(componentTypeEnum, componentId, resourceInstanceId, inputProperty, userId);
926 public void testDeletePropertyValue() throws Exception {
927 ComponentInstanceBusinessLogic testSubject;
928 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
929 Component service = createService();
930 String serviceId = service.getUniqueId();
931 String resourceInstanceId = "";
932 String propertyValueId = "";
933 String userId = user.getUserId();
934 Either<ComponentInstanceProperty,ResponseFormat> result;
936 when(toscaOperationFacade.getToscaElement(serviceId, JsonParseFlagEnum.ParseMetadata)).thenReturn(Either.left(service));
939 testSubject=createTestSubject();
940 result=testSubject.deletePropertyValue(componentTypeEnum, serviceId, resourceInstanceId, propertyValueId, userId);
941 componentTypeEnum= null;
942 result=testSubject.deletePropertyValue(componentTypeEnum, serviceId, resourceInstanceId, propertyValueId, userId);
944 when(toscaOperationFacade.getToscaElement(serviceId, JsonParseFlagEnum.ParseMetadata)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
945 result=testSubject.deletePropertyValue(componentTypeEnum, serviceId, resourceInstanceId, propertyValueId, userId);
950 public void testGetAndValidateOriginComponentOfComponentInstance() throws Exception {
951 ComponentInstanceBusinessLogic testSubject;
952 ComponentTypeEnum containerComponentType = ComponentTypeEnum.RESOURCE;
953 Component resource = createResource();
954 ComponentInstance componentInstance = createInstances();
955 Either<Component,ResponseFormat> result;
957 when(toscaOperationFacade.getToscaFullElement(componentInstance.getComponentUid())).thenReturn(Either.left(resource));
960 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "getAndValidateOriginComponentOfComponentInstance", new Object[]{containerComponentType, componentInstance});
968 public void testGetComponentParametersViewForForwardingPath() throws Exception {
969 ComponentInstanceBusinessLogic testSubject;
970 ComponentParametersView result;
973 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "getComponentParametersViewForForwardingPath");
978 public void testChangeComponentInstanceVersion() throws Exception {
979 ComponentInstanceBusinessLogic testSubject;
980 String containerComponentParam = "";
981 String containerComponentId = "";
982 String componentInstanceId = "";
983 String userId = user.getUserId();
984 ComponentInstance newComponentInstance = createInstances();
985 Either<ComponentInstance,ResponseFormat> result;
988 testSubject=createTestSubject();result=testSubject.changeComponentInstanceVersion(containerComponentParam, containerComponentId, componentInstanceId, userId, newComponentInstance);
989 newComponentInstance = null;
990 testSubject=createTestSubject();result=testSubject.changeComponentInstanceVersion(containerComponentParam, containerComponentId, componentInstanceId, userId, newComponentInstance);
995 public void testValidateInstanceNameUniquenessUponUpdate() throws Exception {
996 ComponentInstanceBusinessLogic testSubject;
997 Component containerComponent = createResource();
998 ComponentInstance oldComponentInstance = createInstances();
999 String newInstanceName = oldComponentInstance.getName();
1003 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "validateInstanceNameUniquenessUponUpdate", new Object[]{containerComponent, oldComponentInstance, newInstanceName});
1008 public void testGetResourceInstanceById() throws Exception {
1009 ComponentInstanceBusinessLogic testSubject;
1010 Component containerComponent = createResource();
1011 String instanceId = "";
1012 Either<ComponentInstance,StorageOperationStatus> result;
1015 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "getResourceInstanceById", new Object[]{containerComponent, instanceId});
1020 public void testBuildComponentInstance() throws Exception {
1021 ComponentInstanceBusinessLogic testSubject;
1022 ComponentInstance resourceInstanceForUpdate = createInstances();
1023 ComponentInstance origInstanceForUpdate = null;
1024 ComponentInstance result;
1027 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "buildComponentInstance", new Object[]{resourceInstanceForUpdate, resourceInstanceForUpdate});
1035 public void testFindCapabilityOfInstance() throws Exception {
1036 ComponentInstanceBusinessLogic testSubject;String componentId = "";
1037 String instanceId = "";
1038 String capabilityType = "";
1039 String capabilityName = "";
1040 String ownerId = "";
1041 Map<String,List<CapabilityDefinition>> instanceCapabilities = new HashMap<>();
1042 Either<List<ComponentInstanceProperty>,ResponseFormat> result;
1045 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "findCapabilityOfInstance", new Object[]{componentId, instanceId, capabilityType, capabilityName, ownerId, instanceCapabilities});
1050 public void testFetchComponentInstanceCapabilityProperties() throws Exception {
1051 ComponentInstanceBusinessLogic testSubject;String componentId = "";
1052 String instanceId = "";
1053 String capabilityType = "";
1054 String capabilityName = "";
1055 String ownerId = "";
1056 Either<List<ComponentInstanceProperty>,ResponseFormat> result;
1059 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "fetchComponentInstanceCapabilityProperties", new Object[]{componentId, instanceId, capabilityType, capabilityName, ownerId});
1064 public void testUpdateCapabilityPropertyOnContainerComponent_1() throws Exception {
1065 ComponentInstanceBusinessLogic testSubject;
1066 ComponentInstanceProperty property = new ComponentInstanceProperty();
1067 String newValue = "";
1068 Component containerComponent = createResource();
1069 ComponentInstance foundResourceInstance = createInstances();
1070 String capabilityType = "";
1071 String capabilityName = "";
1072 String ownerId = "";
1073 ResponseFormat result;
1076 testSubject=createTestSubject();result=Deencapsulation.invoke(testSubject, "updateCapabilityPropertyOnContainerComponent", new Object[]{property, newValue, containerComponent, foundResourceInstance, capabilityType, capabilityName, ownerId});
1081 public void testUpdateInstanceCapabilityProperties() throws Exception {
1082 ComponentInstanceBusinessLogic testSubject;
1083 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
1084 Component resource = createResource();
1085 String containerComponentId = resource.getUniqueId();
1086 String componentInstanceUniqueId = "";
1087 String capabilityType = "";
1088 String capabilityName = "";
1089 String ownerId = "";
1090 List<ComponentInstanceProperty> properties = new ArrayList<>();
1091 String userId = user.getUserId();
1092 Either<List<ComponentInstanceProperty>,ResponseFormat> result;
1095 when(toscaOperationFacade.getToscaFullElement(containerComponentId)).thenReturn(Either.left(resource));
1100 testSubject=createTestSubject();
1101 result=testSubject.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, ownerId, properties, userId);
1102 when(toscaOperationFacade.getToscaFullElement(containerComponentId)).thenReturn(Either.right(StorageOperationStatus.ARTIFACT_NOT_FOUND));
1103 result=testSubject.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, ownerId, properties, userId);
1104 componentTypeEnum = null;
1105 result=testSubject.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, ownerId, properties, userId);
1112 public void testUpdateInstanceCapabilityProperties_1() throws Exception {
1113 ComponentInstanceBusinessLogic testSubject;
1114 ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE;
1115 Component component = createResource();
1116 String containerComponentId = component.getUniqueId();
1117 String componentInstanceUniqueId = "";
1118 String capabilityType = "";
1119 String capabilityName = "";
1120 List<ComponentInstanceProperty> properties = new ArrayList<>();
1121 String userId = user.getUserId();
1122 Either<List<ComponentInstanceProperty>,ResponseFormat> result;
1125 when(toscaOperationFacade.getToscaFullElement(containerComponentId)).thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
1127 testSubject=createTestSubject();
1128 result=testSubject.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, properties, userId);
1129 when(toscaOperationFacade.getToscaFullElement(containerComponentId)).thenReturn(Either.left(component));
1130 result=testSubject.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, properties, userId);