3 * Copyright (c) 2018 AT&T Intellectual Property.
7 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
27 * limitations under the License.
31 package org.openecomp.sdc.be.components.impl;
33 import fj.data.Either;
35 import java.io.IOException;
36 import java.lang.reflect.InvocationTargetException;
37 import java.lang.reflect.Method;
38 import java.nio.file.Files;
39 import java.nio.file.Path;
40 import java.nio.file.Paths;
41 import java.util.HashMap;
44 import org.apache.commons.codec.binary.Base64;
45 import org.junit.Before;
46 import org.mockito.Mock;
47 import org.mockito.Mockito;
48 import org.openecomp.sdc.ElementOperationMock;
49 import org.openecomp.sdc.be.auditing.impl.AuditingManager;
50 import org.openecomp.sdc.be.components.csar.CsarArtifactsAndGroupsBusinessLogic;
51 import org.openecomp.sdc.be.components.csar.CsarInfo;
52 import org.openecomp.sdc.be.components.distribution.engine.DistributionEngine;
53 import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
54 import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic;
55 import org.openecomp.sdc.be.components.impl.utils.CreateServiceFromYamlParameter;
56 import org.openecomp.sdc.be.components.path.ForwardingPathValidator;
57 import org.openecomp.sdc.be.components.validation.NodeFilterValidator;
58 import org.openecomp.sdc.be.components.validation.ServiceDistributionValidation;
59 import org.openecomp.sdc.be.components.validation.UserValidations;
60 import org.openecomp.sdc.be.components.validation.component.*;
61 import org.openecomp.sdc.be.components.validation.service.*;
62 import org.openecomp.sdc.be.dao.api.ActionStatus;
63 import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
64 import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
65 import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao;
66 import org.openecomp.sdc.be.datamodel.utils.UiComponentDataConverter;
67 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
68 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
69 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
70 import org.openecomp.sdc.be.externalapi.servlet.representation.*;
71 import org.openecomp.sdc.be.facade.operations.CatalogOperation;
72 import org.openecomp.sdc.be.impl.ComponentsUtils;
73 import org.openecomp.sdc.be.impl.WebAppContextWrapper;
74 import org.openecomp.sdc.be.model.*;
75 import org.openecomp.sdc.be.model.category.CategoryDefinition;
76 import org.openecomp.sdc.be.model.jsonjanusgraph.operations.NodeFilterOperation;
77 import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
78 import org.openecomp.sdc.be.model.operations.api.IElementOperation;
79 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
80 import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation;
81 import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
82 import org.openecomp.sdc.be.servlets.AbstractValidationsServlet;
83 import org.openecomp.sdc.be.user.Role;
84 import org.openecomp.sdc.be.user.UserBusinessLogic;
85 import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
86 import org.openecomp.sdc.common.api.Constants;
87 import org.openecomp.sdc.common.api.UploadArtifactInfo;
88 import org.openecomp.sdc.exception.ResponseFormat;
89 import org.springframework.web.context.WebApplicationContext;
91 import javax.servlet.ServletContext;
94 import static org.assertj.core.api.Java6Assertions.assertThat;
95 import static org.junit.Assert.assertEquals;
96 import static org.mockito.ArgumentMatchers.*;
97 import static org.mockito.Mockito.when;
99 public class ServiceImportBussinessLogicBaseTestSetup extends BaseBusinessLogicMock {
100 protected ServiceImportBusinessLogic sIB1;
101 protected static final String SERVICE_CATEGORY = "Mobility";
102 protected static final String INSTANTIATION_TYPE = "A-la-carte";
103 protected final ServletContext servletContext = Mockito.mock(ServletContext.class);
104 protected UserBusinessLogic mockUserAdmin = Mockito.mock(UserBusinessLogic.class);
105 protected WebAppContextWrapper webAppContextWrapper = Mockito.mock(WebAppContextWrapper.class);
106 protected WebApplicationContext webAppContext = Mockito.mock(WebApplicationContext.class);
107 protected ResponseFormatManager responseManager = null;
108 protected ComponentsUtils componentsUtils = new ComponentsUtils(Mockito.mock(AuditingManager.class));
109 protected AuditCassandraDao auditingDao = Mockito.mock(AuditCassandraDao.class);
110 protected ArtifactsBusinessLogic artifactBl = Mockito.mock(ArtifactsBusinessLogic.class);
111 protected GraphLockOperation graphLockOperation = Mockito.mock(GraphLockOperation.class);
112 protected JanusGraphDao mockJanusGraphDao = Mockito.mock(JanusGraphDao.class);
113 protected ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class);
114 protected CsarArtifactsAndGroupsBusinessLogic csarArtifactsAndGroupsBusinessLogic = Mockito.mock(CsarArtifactsAndGroupsBusinessLogic.class);
115 protected GenericTypeBusinessLogic genericTypeBusinessLogic = Mockito.mock(GenericTypeBusinessLogic.class);
116 protected UserValidations userValidations = Mockito.mock(UserValidations.class);
117 protected ResourceAdminEvent auditArchive1 = Mockito.mock(ResourceAdminEvent.class);
118 protected CatalogOperation catalogOperation = Mockito.mock(CatalogOperation.class);
119 protected ResourceAdminEvent auditArchive2 = Mockito.mock(ResourceAdminEvent.class);
120 protected ResourceAdminEvent auditRestore = Mockito.mock(ResourceAdminEvent.class);
121 protected ServiceImportParseLogic serviceImportParseLogic = Mockito.mock(ServiceImportParseLogic.class);
122 IElementOperation mockElementDao = new ElementOperationMock();
123 DistributionEngine distributionEngine = Mockito.mock(DistributionEngine.class);
124 ServiceDistributionValidation serviceDistributionValidation = Mockito.mock(ServiceDistributionValidation.class);
125 ComponentInstanceBusinessLogic componentInstanceBusinessLogic = Mockito.mock(ComponentInstanceBusinessLogic.class);
126 ForwardingPathValidator forwardingPathValidator = Mockito.mock(ForwardingPathValidator.class);
127 UiComponentDataConverter uiComponentDataConverter = Mockito.mock(UiComponentDataConverter.class);
128 NodeFilterOperation serviceFilterOperation = Mockito.mock(NodeFilterOperation.class);
129 NodeFilterValidator serviceFilterValidator = Mockito.mock(NodeFilterValidator.class);
130 protected ServiceTypeValidator serviceTypeValidator = new ServiceTypeValidator(componentsUtils);
131 protected ServiceCategoryValidator serviceCategoryValidator = new ServiceCategoryValidator(componentsUtils, mockElementDao);
132 protected ServiceRoleValidator serviceRoleValidator = new ServiceRoleValidator(componentsUtils);
133 protected ServiceFunctionValidator serviceFunctionValidator = new ServiceFunctionValidator(componentsUtils);
134 protected ServiceInstantiationTypeValidator serviceInstantiationTypeValidator = new ServiceInstantiationTypeValidator(componentsUtils);
135 protected ComponentDescriptionValidator componentDescriptionValidator = new ComponentDescriptionValidator(componentsUtils);
136 protected ComponentProjectCodeValidator componentProjectCodeValidator = new ComponentProjectCodeValidator(componentsUtils);
137 protected ComponentIconValidator componentIconValidator = new ComponentIconValidator(componentsUtils);
138 protected ComponentContactIdValidator componentContactIdValidator = new ComponentContactIdValidator(componentsUtils);
139 protected ComponentTagsValidator componentTagsValidator = new ComponentTagsValidator(componentsUtils);
140 protected ComponentNameValidator componentNameValidator = new ComponentNameValidator(componentsUtils, toscaOperationFacade);
141 protected final ComponentValidator componentValidator = Mockito.mock(ComponentValidator.class);
142 protected ServiceValidator serviceValidator = createServiceValidator();
144 protected User user = null;
145 protected Resource genericService = null;
147 private static final String RESOURCE_NAME = "My-Resource_Name with space";
148 private static final String RESOURCE_TOSCA_NAME = "My-Resource_Tosca_Name";
149 private static final String RESOURCE_CATEGORY1 = "Network Layer 2-3";
150 private static final String RESOURCE_SUBCATEGORY = "Router";
151 protected static final String CERTIFIED_VERSION = "1.0";
152 protected static final String UNCERTIFIED_VERSION = "0.2";
153 protected static final String COMPONNET_ID = "myUniqueId";
154 protected static final String GENERIC_SERVICE_NAME = "org.openecomp.resource.abstract.nodes.service";
156 protected static final String SERVICE_ROLE = JsonPresentationFields.SERVICE_ROLE.getPresentation();
157 protected static final String SERVICE_TYPE = JsonPresentationFields.SERVICE_TYPE.getPresentation();
158 protected static final String SERVICE_FUNCTION = JsonPresentationFields.SERVICE_FUNCTION.getPresentation();
160 public ServiceImportBussinessLogicBaseTestSetup() {
164 protected ServiceValidator createServiceValidator() {
165 List<ComponentFieldValidator> componentFieldValidators = Arrays.asList(componentContactIdValidator,
166 componentDescriptionValidator,
167 componentIconValidator, componentNameValidator,
168 new ComponentProjectCodeValidator(componentsUtils),
169 componentTagsValidator);
171 List<ServiceFieldValidator> serviceFieldValidators = Arrays.asList(serviceCategoryValidator, new ServiceEnvironmentContextValidator(),
172 serviceInstantiationTypeValidator, new ServiceNamingPolicyValidator(componentsUtils),
173 serviceRoleValidator, serviceTypeValidator);
174 return new ServiceValidator(componentsUtils, componentFieldValidators, serviceFieldValidators);
178 public void setup() {
181 IElementOperation mockElementDao = new ElementOperationMock();
183 // User data and management
185 user.setUserId("jh0003");
186 user.setFirstName("Jimmi");
187 user.setLastName("Hendrix");
188 user.setRole(Role.ADMIN.name());
190 when(mockUserAdmin.getUser("jh0003", false)).thenReturn(user);
191 when(userValidations.validateUserExists(eq("jh0003"))).thenReturn(user);
192 when(userValidations.validateUserNotEmpty(eq(user), anyString())).thenReturn(user);
193 // when(userValidations.validateUserRole(user))
194 // Servlet Context attributes
195 when(servletContext.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)).thenReturn(configurationManager);
196 // when(servletContext.getAttribute(Constants.SERVICE_OPERATION_MANAGER)).thenReturn(new ServiceOperation());
197 when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)).thenReturn(webAppContextWrapper);
198 when(webAppContextWrapper.getWebAppContext(servletContext)).thenReturn(webAppContext);
199 when(webAppContext.getBean(IElementOperation.class)).thenReturn(mockElementDao);
200 when(graphLockOperation.lockComponent(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Service))).thenReturn(StorageOperationStatus.OK);
201 when(graphLockOperation.lockComponentByName(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Service))).thenReturn(StorageOperationStatus.OK);
202 when(catalogOperation.updateCatalog(Mockito.any(), Mockito.any())).thenReturn(ActionStatus.OK);
203 // artifact bussinesslogic
204 ArtifactDefinition artifactDef = new ArtifactDefinition();
205 when(artifactBl.createArtifactPlaceHolderInfo(Mockito.any(), Mockito.anyString(), Mockito.anyMap(), Mockito.any(User.class), Mockito.any(ArtifactGroupTypeEnum.class))).thenReturn(artifactDef);
208 Service serviceResponse = createServiceObject(true);
209 Either<Component, StorageOperationStatus> eitherCreate = Either.left(serviceResponse);
210 when(toscaOperationFacade.createToscaComponent(Mockito.any(Component.class))).thenReturn(eitherCreate);
211 when(toscaOperationFacade.getToscaElement(Mockito.anyString())).thenReturn(eitherCreate);
212 Either<Boolean, StorageOperationStatus> eitherCount = Either.left(false);
213 when(toscaOperationFacade.validateComponentNameExists("Service", null, ComponentTypeEnum.SERVICE)).thenReturn(eitherCount);
214 Either<Boolean, StorageOperationStatus> eitherCountExist = Either.left(true);
215 when(toscaOperationFacade.validateComponentNameExists("alreadyExist", null, ComponentTypeEnum.SERVICE)).thenReturn(eitherCountExist);
216 when(userValidations.validateUserExists(user)).thenReturn(user);
219 Resource resourceRsponse = createParseResourceObject(true);
220 Either<Component, StorageOperationStatus> eitherResourceCreate = Either.left(resourceRsponse);
221 when(toscaOperationFacade.createToscaComponent(Mockito.any(Component.class))).thenReturn(eitherResourceCreate);
222 Either<Component, StorageOperationStatus> eitherResourceRes = Either.left(resourceRsponse);
223 when(toscaOperationFacade.getToscaFullElement(Mockito.anyString())).thenReturn(eitherResourceRes);
225 Either<Boolean, StorageOperationStatus> eitherResourceCount = Either.left(false);
226 when(toscaOperationFacade.validateComponentNameExists("Resource", null, ComponentTypeEnum.RESOURCE)).thenReturn(eitherResourceCount);
227 Either<Boolean, StorageOperationStatus> eitherResourceCountExist = Either.left(true);
228 when(toscaOperationFacade.validateComponentNameExists("alreadyExist", null, ComponentTypeEnum.RESOURCE)).thenReturn(eitherResourceCountExist);
230 genericService = setupGenericServiceMock();
231 Either<Resource, StorageOperationStatus> findLatestGeneric = Either.left(genericService);
232 when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_SERVICE_NAME)).thenReturn(findLatestGeneric);
234 when(serviceImportParseLogic.isArtifactDeletionRequired(anyString(),any(),anyBoolean())).thenReturn(true);
235 Either<Boolean, ResponseFormat> validateCGD = Either.left(true);
236 when(serviceImportParseLogic.validateCyclicGroupsDependencies(any())).thenReturn(validateCGD);
238 sIB1 = new ServiceImportBusinessLogic(elementDao, groupOperation, groupInstanceOperation,
239 groupTypeOperation, groupBusinessLogic, interfaceOperation, interfaceLifecycleTypeOperation,
240 artifactBl, distributionEngine, componentInstanceBusinessLogic,
241 serviceDistributionValidation, forwardingPathValidator, uiComponentDataConverter, serviceFilterOperation,
242 serviceFilterValidator, artifactToscaOperation, componentContactIdValidator,
243 componentNameValidator, componentTagsValidator, componentValidator,
244 componentIconValidator, componentProjectCodeValidator, componentDescriptionValidator);
249 responseManager = ResponseFormatManager.getInstance();
252 protected Service createServiceObject(boolean afterCreate) {
253 Service service = new Service();
254 service.setUniqueId("sid");
255 service.setName("Service");
256 CategoryDefinition category = new CategoryDefinition();
257 category.setName(SERVICE_CATEGORY);
258 category.setIcons(Collections.singletonList("defaulticon"));
259 List<CategoryDefinition> categories = new ArrayList<>();
260 categories.add(category);
261 service.setCategories(categories);
262 service.setInstantiationType(INSTANTIATION_TYPE);
264 service.setDescription("description");
265 List<String> tgs = new ArrayList<>();
266 tgs.add(service.getName());
267 service.setTags(tgs);
268 // service.setVendorName("Motorola");
269 // service.setVendorRelease("1.0.0");
270 service.setIcon("defaulticon");
271 // service.setState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
272 service.setContactId("aa1234");
273 service.setProjectCode("12345");
274 service.setEcompGeneratedNaming(true);
277 service.setVersion("0.1");
278 service.setUniqueId(service.getName() + ":" + service.getVersion());
279 service.setCreatorUserId(user.getUserId());
280 service.setCreatorFullName(user.getFirstName() + " " + user.getLastName());
285 protected Resource createResourceObject(boolean afterCreate) {
286 Resource resource = new Resource();
287 resource.setUniqueId("sid");
288 resource.setName("Service");
289 CategoryDefinition category = new CategoryDefinition();
290 category.setName(SERVICE_CATEGORY);
291 category.setIcons(Collections.singletonList("defaulticon"));
292 List<CategoryDefinition> categories = new ArrayList<>();
293 categories.add(category);
294 resource.setCategories(categories);
297 resource.setDescription("description");
298 List<String> tgs = new ArrayList<>();
299 tgs.add(resource.getName());
300 resource.setTags(tgs);
301 resource.setIcon("defaulticon");
302 resource.setContactId("aa1234");
303 resource.setProjectCode("12345");
307 resource.setVersion("0.1");
308 resource.setUniqueId(resource.getName() + ":" + resource.getVersion());
309 resource.setCreatorUserId(user.getUserId());
310 resource.setCreatorFullName(user.getFirstName() + " " + user.getLastName());
315 protected Resource createParseResourceObject(boolean afterCreate) {
316 Resource resource = new Resource();
317 resource.setName(RESOURCE_NAME);
318 resource.setToscaResourceName(RESOURCE_TOSCA_NAME);
319 resource.addCategory(RESOURCE_CATEGORY1, RESOURCE_SUBCATEGORY);
320 resource.setDescription("My short description");
321 List<String> tgs = new ArrayList<>();
323 tgs.add(resource.getName());
324 resource.setTags(tgs);
325 List<String> template = new ArrayList<>();
326 template.add("tosca.nodes.Root");
327 resource.setDerivedFrom(template);
328 resource.setVendorName("Motorola");
329 resource.setVendorRelease("1.0.0");
330 resource.setContactId("ya5467");
331 resource.setIcon("defaulticon");
332 Map<String, List<RequirementDefinition>> requirements = new HashMap<>();
333 List<RequirementDefinition> requirementDefinitionList= new ArrayList<>();
334 requirements.put("test", requirementDefinitionList);
335 resource.setRequirements(requirements);
338 resource.setName(resource.getName());
339 resource.setVersion("0.1");
340 resource.setUniqueId(resource.getName()
341 .toLowerCase() + ":" + resource.getVersion());
342 resource.setCreatorUserId(user.getUserId());
343 resource.setCreatorFullName(user.getFirstName() + " " + user.getLastName());
344 resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
348 protected Resource setupGenericServiceMock() {
349 Resource genericService = new Resource();
350 genericService.setVersion("1.0");
351 genericService.setToscaResourceName(GENERIC_SERVICE_NAME);
352 return genericService;
356 protected Map<String, GroupDefinition> getGroups() {
357 Map<String, GroupDefinition> groups = new HashMap<>();
358 GroupDefinition groupDefinition = new GroupDefinition();
359 groupDefinition.setName("groupDefinitionName");
360 groups.put("groupsMap",groupDefinition);
364 protected UploadComponentInstanceInfo getuploadComponentInstanceInfo(){
365 UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
366 uploadComponentInstanceInfo.setType("resources");
367 Collection<String> directives = new Collection<String>() {
374 public boolean isEmpty() {
379 public boolean contains(Object o) {
384 public Iterator<String> iterator() {
389 public Object[] toArray() {
390 return new Object[0];
394 public <T> T[] toArray(T[] ts) {
399 public boolean add(String s) {
404 public boolean remove(Object o) {
409 public boolean containsAll(Collection<?> collection) {
414 public boolean addAll(Collection<? extends String> collection) {
419 public boolean removeAll(Collection<?> collection) {
424 public boolean retainAll(Collection<?> collection) {
429 public void clear() {
433 uploadComponentInstanceInfo.setDirectives(directives);
434 UploadNodeFilterInfo uploadNodeFilterInfo = new UploadNodeFilterInfo();
435 Map<String, List<UploadReqInfo>> requirements = new HashMap<>();
436 List<UploadReqInfo> uploadReqInfoList = new ArrayList<>();
437 UploadReqInfo uploadReqInfo = new UploadReqInfo();
438 uploadReqInfo.setName("uploadReqInfo");
439 uploadReqInfo.setCapabilityName("tosca.capabilities.Node");
440 uploadReqInfoList.add(uploadReqInfo);
441 requirements.put("requirements",uploadReqInfoList);
442 uploadNodeFilterInfo.setName("mme_ipu_vdu.virtualbinding");
443 uploadComponentInstanceInfo.setCapabilities(getCapabilities());
444 uploadComponentInstanceInfo.setRequirements(requirements);
445 uploadComponentInstanceInfo.setName("zxjTestImportServiceAb");
446 return uploadComponentInstanceInfo;
449 protected Map<String, List<UploadCapInfo>> getCapabilities(){
450 List<UploadCapInfo> uploadCapInfoList = new ArrayList<>();
451 UploadCapInfo uploadCapInfo = new UploadCapInfo();
452 uploadCapInfo.setNode("tosca.nodes.Root");
453 uploadCapInfo.setName("mme_ipu_vdu.dependency");
454 uploadCapInfoList.add(uploadCapInfo);
455 Map<String, List<UploadCapInfo>> uploadCapInfoMap = new HashMap<>();
456 uploadCapInfoMap.put("tosca.capabilities.Node",uploadCapInfoList);
457 return uploadCapInfoMap;
460 protected List<ComponentInstance> creatComponentInstances(){
461 List<ComponentInstance> componentInstances = new ArrayList<>();
462 ComponentInstance componentInstance = new ComponentInstance();
463 Map<String, List<CapabilityDefinition>> capabilities = new HashMap<>();
464 List<CapabilityDefinition> capabilityDefinitionList = new ArrayList<>();
465 CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
466 capabilityDefinition.setName("mme_ipu_vdu.feature");
467 capabilityDefinitionList.add(capabilityDefinition);
468 capabilities.put("tosca.capabilities.Node",capabilityDefinitionList);
470 Map<String, List<RequirementDefinition>> requirements = new HashMap<>();
471 List<RequirementDefinition> requirementDefinitionList = new ArrayList<>();
472 RequirementDefinition requirementDefinition = new RequirementDefinition();
473 requirementDefinition.setName("zxjtestimportserviceab0.mme_ipu_vdu.dependency.test");
474 requirementDefinitionList.add(requirementDefinition);
475 requirements.put("tosca.capabilities.Node",requirementDefinitionList);
476 componentInstance.setRequirements(requirements);
477 componentInstance.setCapabilities(capabilities);
478 componentInstance.setUniqueId("uniqueId");
479 componentInstance.setComponentUid("componentUid");
480 componentInstance.setName("zxjTestImportServiceAb");
481 componentInstances.add(componentInstance);
482 return componentInstances;
485 protected UploadComponentInstanceInfo createUploadComponentInstanceInfo(){
486 UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
487 uploadComponentInstanceInfo.setName("UploadComponentInstanceInfo");
488 return uploadComponentInstanceInfo;
491 private void mockAbstract() {
492 checkCreateAbstract();
497 private void checkCreateAbstract(){
498 AbstractResourceInfo abstractResourceInfo = new AbstractResourceInfo();
499 List<RequirementCapabilityRelDef> componentInstancesRelations = new ArrayList<>();
500 abstractResourceInfo.setComponentInstancesRelations(componentInstancesRelations);
501 abstractResourceInfo.setAbstractResourceUniqueId("abstractResourceUniqueId");
502 abstractResourceInfo.setAbstractResourceName("abstractResourceName");
503 abstractResourceInfo.setAbstractResourceUUid("abstractResourceUUid");
505 AbstractResourceInfo getAbstractResourceInfo = new AbstractResourceInfo();
506 getAbstractResourceInfo.getAbstractResourceName();
507 getAbstractResourceInfo.getAbstractResourceUniqueId();
508 getAbstractResourceInfo.getAbstractResourceUUid();
509 getAbstractResourceInfo.getComponentInstancesRelations();
511 AbstractTemplateInfo createAbstractTemplateInfo = new AbstractTemplateInfo();
512 List<AbstractResourceInfo> abstractResourceInfoList = new ArrayList<>();
513 abstractResourceInfoList.add(abstractResourceInfo);
514 createAbstractTemplateInfo.setAbstractResourceInfoList(abstractResourceInfoList);
515 createAbstractTemplateInfo.setServiceUniqueId("serviceUniqueId");
516 createAbstractTemplateInfo.setIsAbstractTemplate(true);
517 createAbstractTemplateInfo.setServiceUUid("serviceUUid");
519 AbstractTemplateInfo getAbstractTemplateInfo = new AbstractTemplateInfo();
520 getAbstractTemplateInfo.getAbstractResourceInfoList();
521 getAbstractTemplateInfo.getIsAbstractTemplate();
522 getAbstractTemplateInfo.getServiceUniqueId();
523 getAbstractTemplateInfo.getServiceUUid();
525 CopyServiceInfo copyServiceInfo = new CopyServiceInfo();
526 copyServiceInfo.setNewServiceName("newServiceName");
527 copyServiceInfo.setNewServiceUUid("serviceUUid");
528 copyServiceInfo.setOldServiceUUid("oldServiceUUid");
530 CopyServiceInfo getCopyServiceInfo = new CopyServiceInfo();
531 getCopyServiceInfo.getNewServiceName();
532 getCopyServiceInfo.getNewServiceUUid();
533 getCopyServiceInfo.getOldServiceUUid();
535 ReplaceVNFInfo replaceVNFInfo = new ReplaceVNFInfo();
536 ComponentInstance realVNFComponentInstance = new ComponentInstance();
537 replaceVNFInfo.setAbstractResourceUniqueId("abstractResourceUniqueId");
538 replaceVNFInfo.setRealVNFComponentInstance(realVNFComponentInstance);
539 replaceVNFInfo.setServiceUniqueId("serviceUniqueId");
541 ReplaceVNFInfo getReplaceVNFInfo = new ReplaceVNFInfo();
542 getReplaceVNFInfo.getServiceUniqueId();
543 getReplaceVNFInfo.getAbstractResourceUniqueId();
544 getReplaceVNFInfo.getRealVNFComponentInstance();
547 private void checkCreateOther(){
548 ResourceInstanceMetadata resourceInstanceMetadata = new ResourceInstanceMetadata();
549 List<ArtifactMetadata> artifacts = new ArrayList<>();
550 resourceInstanceMetadata.setArtifacts(artifacts);
551 resourceInstanceMetadata.setResoucreType("resoucreType");
552 resourceInstanceMetadata.setResourceInstanceName("resourceInstanceName");
553 resourceInstanceMetadata.setResourceInvariantUUID("resourceInvariantUUID");
554 resourceInstanceMetadata.setResourceName("resourceName");
555 resourceInstanceMetadata.setResourceUUID("resourceUUID");
556 resourceInstanceMetadata.setResourceVersion("resourceVersion");
558 ResourceInstanceMetadata getResourceInstanceMetadata = new ResourceInstanceMetadata();
559 getResourceInstanceMetadata.getArtifacts();
560 getResourceInstanceMetadata.getResoucreType();
561 getResourceInstanceMetadata.getResourceInstanceName();
562 getResourceInstanceMetadata.getResourceInvariantUUID();
563 getResourceInstanceMetadata.getResourceName();
564 getResourceInstanceMetadata.getResourceUUID();
565 getResourceInstanceMetadata.getResourceVersion();
567 UploadServiceInfo uploadServiceInfo = new UploadServiceInfo();
568 List<String> tags = new ArrayList<>();
569 List<CategoryDefinition> categories = new ArrayList<>();
570 List<UploadArtifactInfo> artifactList = new ArrayList<>();
571 uploadServiceInfo.setProjectCode("projectCode");
572 uploadServiceInfo.setCategories(categories);
573 uploadServiceInfo.setServiceType("");
574 uploadServiceInfo.setServiceVendorModelNumber("serviceVendorModelNumber");
575 uploadServiceInfo.setVendorRelease("vendorRelease");
576 uploadServiceInfo.setVendorName("vendorName");
577 uploadServiceInfo.setServiceIconPath("serviceIconPath");
578 uploadServiceInfo.setName("uploadServiceInfo");
579 uploadServiceInfo.setContactId("contactId");
580 uploadServiceInfo.setIcon("icon");
581 uploadServiceInfo.setNamingPolicy("namingPolicy");
582 uploadServiceInfo.setEcompGeneratedNaming("ecompGeneratedNaming");
583 uploadServiceInfo.setServiceEcompNaming("serviceEcompNaming");
584 uploadServiceInfo.setServiceRole("serviceRole");
585 uploadServiceInfo.setSubcategory("subcategory");
586 uploadServiceInfo.setCategory("category");
587 uploadServiceInfo.setType("type");
588 uploadServiceInfo.setUUID("UUID");
589 uploadServiceInfo.setInvariantUUID("invariantUUID");
590 uploadServiceInfo.setResourceVendorRelease("resourceVendorRelease");
591 uploadServiceInfo.setResourceVendor("resourceVendor");
592 uploadServiceInfo.setDescription("description");
593 uploadServiceInfo.setTags(tags);
594 uploadServiceInfo.setArtifactList(artifactList);
595 uploadServiceInfo.setPayloadName("payloadName");
596 uploadServiceInfo.setPayloadData("payloadData");
599 protected void checkGetUploadServiceInfo(){
600 UploadServiceInfo uploadServiceInfo = new UploadServiceInfo();
601 List<String> tags = new ArrayList<>();
602 List<CategoryDefinition> categories = new ArrayList<>();
603 List<UploadArtifactInfo> artifactList = new ArrayList<>();
604 uploadServiceInfo.getProjectCode();
605 uploadServiceInfo.getCategories();
606 uploadServiceInfo.getServiceType();
607 uploadServiceInfo.getServiceVendorModelNumber();
608 uploadServiceInfo.getVendorRelease();
609 uploadServiceInfo.getVendorName();
610 uploadServiceInfo.getServiceIconPath();
611 uploadServiceInfo.getName();
612 uploadServiceInfo.getContactId();
613 uploadServiceInfo.getIcon();
614 uploadServiceInfo.getNamingPolicy();
615 uploadServiceInfo.getEcompGeneratedNaming();
616 uploadServiceInfo.getServiceEcompNaming();
617 uploadServiceInfo.getServiceRole();
618 uploadServiceInfo.getSubcategory();
619 uploadServiceInfo.getCategory();
620 uploadServiceInfo.getType();
621 uploadServiceInfo.getUUID();
622 uploadServiceInfo.getInvariantUUID();
623 uploadServiceInfo.getResourceVendorRelease();
624 uploadServiceInfo.getResourceVendor();
625 uploadServiceInfo.getDescription();
626 uploadServiceInfo.getTags();
627 uploadServiceInfo.getArtifactList();
628 uploadServiceInfo.getPayloadName();
629 uploadServiceInfo.getPayloadData();
632 private void checkCreateFile(){
633 CreateServiceFromYamlParameter csfp = new CreateServiceFromYamlParameter();
634 Map<String, NodeTypeInfo> nodeTypesInfo = new HashMap<>();
635 ParsedToscaYamlInfo parsedToscaYamlInfo = new ParsedToscaYamlInfo();
636 List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
637 CsarInfo csarInfo = getCsarInfo();
638 csfp.setYamlName("yamlName");
639 csfp.setNodeTypesInfo(nodeTypesInfo);
640 csfp.setParsedToscaYamlInfo(parsedToscaYamlInfo);
641 csfp.setCsarInfo(csarInfo);
642 csfp.setCreatedArtifacts(createdArtifacts);
643 csfp.setYamlName("yamlName");
644 csfp.setShouldLock(true);
645 csfp.setInTransaction(true);
646 csfp.setNodeName("nodeName");
648 CreateServiceFromYamlParameter getCsfy = new CreateServiceFromYamlParameter();
649 getCsfy.getYamlName();
650 getCsfy.getNodeTypesInfo();
651 getCsfy.getParsedToscaYamlInfo();
652 getCsfy.getCsarInfo();
653 getCsfy.getCreatedArtifacts();
654 getCsfy.getYamlName();
655 getCsfy.isShouldLock();
656 getCsfy.isInTransaction();
657 getCsfy.getNodeName();
660 protected CsarInfo getCsarInfo ()
662 String csarUuid = "0010";
663 User user = new User();
664 Map<String, byte[]> csar = crateCsarFromPayload();
665 String vfReousrceName = "resouceName";
666 String mainTemplateName = "mainTemplateName";
667 String mainTemplateContent = getMainTemplateContent();
668 final Service service = createServiceObject(false);
669 CsarInfo csarInfo = new CsarInfo(user, csarUuid, csar, vfReousrceName, mainTemplateName, mainTemplateContent, false);
673 protected Map<String, byte[]> crateCsarFromPayload() {
674 String payloadName = "valid_vf.csar";
675 byte[] data = new byte[1024];
676 Map<String, byte[]> returnValue = new HashMap<>();
677 returnValue.put(payloadName,data);
682 protected String getGroupsYaml(){
683 return "zxjTestImportServiceAb 0:\n" +
684 " type: org.openecomp.resource.vf.Zxjtestimportserviceab\n" +
686 " invariantUUID: 41474f7f-3195-443d-a0a2-eb6020a56279\n" +
687 " UUID: 92e32e49-55f8-46bf-984d-a98c924037ec\n" +
688 " customizationUUID: 40286158-96d0-408e-9f27-21d43817d37c\n" +
689 " version: '1.0'\n" +
690 " name: zxjTestImportServiceAb\n" +
691 " description: zxjTestImportServiceAbstract\n" +
693 " category: Generic\n" +
694 " subcategory: Abstract\n" +
695 " resourceVendor: zxjImportService\n" +
696 " resourceVendorRelease: '1.0'\n" +
697 " resourceVendorModelNumber: ''\n" +
699 " skip_post_instantiation_configuration: true\n" +
701 " ecomp_generated_naming: true\n" +
702 " multi_stage_design: 'false'\n" +
703 " controller_actor: SO-REF-DATA\n" +
704 " availability_zone_max_count: 1\n" +
706 " - imagefile.dependency:\n" +
707 " capability: feature\n" +
708 " node: ext ZTE VL 0\n" +
709 " - mme_ipu_vdu.dependency:\n" +
710 " capability: feature\n" +
713 " mme_ipu_vdu.scalable:\n" +
715 " max_instances: 1\n" +
716 " min_instances: 1\n" +
717 " mme_ipu_vdu.nfv_compute:\n" +
720 " flavor_extra_specs: {\n" +
725 protected String getYamlFileContent(){
726 return "tosca_definitions_version: tosca_simple_yaml_1_1\n" +
730 " tosca.groups.Root:\n" +
731 " description: The TOSCA Group Type all other TOSCA Group Types derive from\n" +
734 " type: tosca.interfaces.node.lifecycle.Standard\n" +
735 " org.openecomp.groups.heat.HeatStack:\n" +
736 " derived_from: tosca.groups.Root\n" +
737 " description: Grouped all heat resources which are in the same heat stack\n" +
741 " description: Heat file which associate to this group/heat stack\n" +
742 " required: true\n" +
743 " status: supported\n" +
746 " description: group description\n" +
747 " required: true\n" +
748 " status: supported\n" +
749 " org.openecomp.groups.VfModule:\n" +
750 " derived_from: tosca.groups.Root\n" +
751 " description: Grouped all heat resources which are in the same VF Module\n" +
755 " description: Whether this module should be deployed before other modules\n" +
756 " required: true\n" +
757 " default: false\n" +
758 " status: supported\n" +
759 " vf_module_label:\n" +
761 " required: true\n" +
762 " description: |\n" +
763 " Alternate textual key used to reference this VF-Module model. Must be unique within the VNF model\n" +
764 " vf_module_description:\n" +
766 " required: true\n" +
767 " description: |\n" +
768 " Description of the VF-modules contents and purpose (e.g. \"Front-End\" or \"Database Cluster\")\n" +
769 " min_vf_module_instances:\n" +
771 " required: true\n" +
772 " description: The minimum instances of this VF-Module\n" +
773 " max_vf_module_instances:\n" +
775 " required: false\n" +
776 " description: The maximum instances of this VF-Module\n" +
777 " initial_count:\n" +
779 " required: false\n" +
780 " description: |\n" +
781 " The initial count of instances of the VF-Module. The value must be in the range between min_vfmodule_instances and max_vfmodule_instances. If no value provided the initial count is the min_vfmodule_instances.\n" +
782 " vf_module_type:\n" +
784 " required: true\n" +
786 " - valid_values:\n" +
791 " required: true\n" +
792 " default: false\n" +
793 " description: |\n" +
794 " \"true\" indicates that this VF Module model requires attachment to a Volume Group. VID operator must select the Volume Group instance to attach to a VF-Module at deployment time.\n" +
795 " availability_zone_count:\n" +
797 " required: false\n" +
798 " description: |\n" +
799 " Quantity of Availability Zones needed for this VF-Module (source: Extracted from VF-Module HEAT template)\n" +
803 " description: <vfc_id>:<count>\n" +
805 " required: false\n" +
806 " description: |\n" +
807 " Identifies the set of VM types and their count included in the VF-Module\n" +
808 " org.openecomp.groups.NetworkCollection:\n" +
809 " derived_from: tosca.groups.Root\n" +
810 " description: groups l3-networks in network collection\n" +
812 " network_collection_function:\n" +
814 " required: true\n" +
815 " description: network collection function\n" +
816 " network_collection_description:\n" +
818 " required: true\n" +
819 " description: network collection description, free format text\n" +
820 " org.openecomp.groups.VfcInstanceGroup:\n" +
821 " derived_from: tosca.groups.Root\n" +
822 " description: groups VFCs with same parent port role\n" +
824 " vfc_instance_group_function:\n" +
826 " required: true\n" +
827 " description: function of this VFC group\n" +
828 " vfc_parent_port_role:\n" +
830 " required: true\n" +
831 " description: common role of parent ports of VFCs in this group\n" +
832 " network_collection_function:\n" +
834 " required: true\n" +
835 " description: network collection function assigned to this group\n" +
836 " subinterface_role:\n" +
838 " required: true\n" +
839 " description: common role of subinterfaces of VFCs in this group, criteria the group is created\n" +
841 " vlan_assignment:\n" +
842 " type: org.openecomp.capabilities.VLANAssignment\n" +
844 " vfc_instance_group_reference:\n" +
846 " tosca.groups.nfv.PlacementGroup:\n" +
847 " derived_from: tosca.groups.Root\n" +
848 " description: PlacementGroup is used for describing the affinity or anti-affinity relationship applicable between the virtualization containers to be created based on different VDUs, or between internal VLs to be created based on different VnfVirtualLinkDesc(s)\n" +
852 " description: Human readable description of the group\n" +
853 " required: true\n" +
855 " - tosca.nodes.nfv.Vdu.Compute\n" +
856 " - tosca.nodes.nfv.VnfVirtualLink";
859 public String getMainTemplateContent(){
860 return "tosca_definitions_version: tosca_simple_yaml_1_1\n"
862 + " invariantUUID: 6d17f281-683b-4198-a676-0faeecdc9025\n"
863 + " UUID: bfeab6b4-199b-4a2b-b724-de416c5e9811\n"
864 + " name: ser09080002\n"
865 + " description: ser09080002\n"
867 + " category: E2E Service\n"
868 + " serviceType: ''\n"
869 + " serviceRole: ''\n"
870 + " instantiationType: A-la-carte\n"
871 + " serviceEcompNaming: true\n"
872 + " ecompGeneratedNaming: true\n"
873 + " namingPolicy: ''\n"
874 + " environmentContext: General_Revenue-Bearing\n"
875 + " serviceFunction: ''\n"
878 + " file: nodes.yml\n"
880 + " file: data.yml\n"
881 + "- capabilities:\n"
882 + " file: capabilities.yml\n"
883 + "- relationships:\n"
884 + " file: relationships.yml\n"
886 + " file: groups.yml\n"
888 + " file: policies.yml\n"
890 + " file: annotations.yml\n"
891 + "- service-ser09080002-interface:\n"
892 + " file: service-Ser09080002-template-interface.yml\n"
893 + "- resource-ExtCP:\n"
894 + " file: resource-Extcp-template.yml\n"
895 + "- resource-zxjTestImportServiceAb:\n"
896 + " file: resource-Zxjtestimportserviceab-template.yml\n"
897 + "- resource-zxjTestImportServiceAb-interface:\n"
898 + " file: resource-Zxjtestimportserviceab-template-interface.yml\n"
899 + "- resource-zxjTestServiceNotAbatract:\n"
900 + " file: resource-Zxjtestservicenotabatract-template.yml\n"
901 + "- resource-zxjTestServiceNotAbatract-interface:\n"
902 + " file: resource-Zxjtestservicenotabatract-template-interface.yml\n"
903 + "- resource-ext ZTE VL:\n"
904 + " file: resource-ExtZteVl-template.yml\n"
905 + "topology_template:\n"
907 + " skip_post_instantiation_configuration:\n"
910 + " required: false\n"
911 + " controller_actor:\n"
912 + " default: SO-REF-DATA\n"
914 + " required: false\n"
915 + " cds_model_version:\n"
917 + " required: false\n"
918 + " cds_model_name:\n"
920 + " required: false\n"
921 + " node_templates:\n"
923 + " type: tosca.nodes.nfv.ext.zte.VL\n"
925 + " invariantUUID: 27ab7610-1a97-4daa-938a-3b48e7afcfd0\n"
926 + " UUID: 9ea63e2c-4b8a-414f-93e3-5703ca5cee0d\n"
927 + " customizationUUID: e45e79b0-07ab-46b4-ac26-1e9f155ce53c\n"
928 + " version: '1.0'\n"
929 + " name: ext ZTE VL\n"
930 + " description: Ext ZTE VL\n"
932 + " category: Generic\n"
933 + " subcategory: Network Elements\n"
934 + " resourceVendor: ONAP (Tosca)\n"
935 + " resourceVendorRelease: 1.0.0.wd03\n"
936 + " resourceVendorModelNumber: ''\n"
937 + " zxjTestServiceNotAbatract 0:\n"
938 + " type: org.openecomp.resource.vf.Zxjtestservicenotabatract\n"
940 + " invariantUUID: ce39ce8d-6f97-4e89-8555-ae6789cdcf1c\n"
941 + " UUID: 4ac822be-f1ae-4ace-a4b8-bf6b5d977005\n"
942 + " customizationUUID: ee34e1e8-68e2-480f-8ba6-f257bbe90d6a\n"
943 + " version: '1.0'\n"
944 + " name: zxjTestServiceNotAbatract\n"
945 + " description: zxjTestServiceNotAbatract\n"
947 + " category: Network L4+\n"
948 + " subcategory: Common Network Resources\n"
949 + " resourceVendor: zxjImportService\n"
950 + " resourceVendorRelease: '1.0'\n"
951 + " resourceVendorModelNumber: ''\n"
954 + " ecomp_generated_naming: true\n"
955 + " skip_post_instantiation_configuration: true\n"
956 + " multi_stage_design: 'false'\n"
957 + " controller_actor: SO-REF-DATA\n"
958 + " availability_zone_max_count: 1\n"
960 + " mme_ipu_vdu.scalable:\n"
962 + " max_instances: 1\n"
963 + " min_instances: 1\n"
964 + " mme_ipu_vdu.nfv_compute:\n"
967 + " flavor_extra_specs: {\n"
969 + " mem_size: '8192'\n"
971 + " type: org.openecomp.resource.cp.extCP\n"
973 + " invariantUUID: 9b772728-93f5-424f-bb07-f4cae2783614\n"
974 + " UUID: 424ac220-4864-453e-b757-917fe4568ff8\n"
975 + " customizationUUID: 6e65d8a8-4379-4693-87aa-82f9e34b92fd\n"
976 + " version: '1.0'\n"
978 + " description: The AT&T Connection Point base type all other CP derive from\n"
980 + " category: Generic\n"
981 + " subcategory: Network Elements\n"
982 + " resourceVendor: ONAP (Tosca)\n"
983 + " resourceVendorRelease: 1.0.0.wd03\n"
984 + " resourceVendorModelNumber: ''\n"
986 + " mac_requirements:\n"
987 + " mac_count_required:\n"
988 + " is_required: false\n"
990 + " ecomp_generated_naming: true\n"
991 + " zxjTestImportServiceAb 0:\n"
992 + " type: org.openecomp.resource.vf.Zxjtestimportserviceab\n"
994 + " invariantUUID: 41474f7f-3195-443d-a0a2-eb6020a56279\n"
995 + " UUID: 92e32e49-55f8-46bf-984d-a98c924037ec\n"
996 + " customizationUUID: 98c7a6c7-a867-45fb-8597-dd464f98e4aa\n"
997 + " version: '1.0'\n"
998 + " name: zxjTestImportServiceAb\n"
999 + " description: zxjTestImportServiceAbstract\n"
1001 + " category: Generic\n"
1002 + " subcategory: Abstract\n"
1003 + " resourceVendor: zxjImportService\n"
1004 + " resourceVendorRelease: '1.0'\n"
1005 + " resourceVendorModelNumber: ''\n"
1008 + " ecomp_generated_naming: true\n"
1009 + " skip_post_instantiation_configuration: true\n"
1010 + " multi_stage_design: 'false'\n"
1011 + " controller_actor: SO-REF-DATA\n"
1012 + " availability_zone_max_count: 1\n"
1013 + " requirements:\n"
1014 + " - mme_ipu_vdu.dependency:\n"
1015 + " capability: feature\n"
1016 + " node: ExtCP 0\n"
1017 + " - imagefile.dependency:\n"
1018 + " capability: feature\n"
1019 + " node: ext ZTE VL 0\n"
1020 + " capabilities:\n"
1021 + " mme_ipu_vdu.scalable:\n"
1023 + " max_instances: 1\n"
1024 + " min_instances: 1\n"
1025 + " mme_ipu_vdu.nfv_compute:\n"
1027 + " num_cpus: '2'\n"
1028 + " flavor_extra_specs: {\n"
1030 + " mem_size: '8192'\n"
1031 + " substitution_mappings:\n"
1032 + " node_type: org.openecomp.service.Ser09080002\n"
1033 + " capabilities:\n"
1034 + " extcp0.feature:\n"
1037 + " zxjtestservicenotabatract0.mme_ipu_vdu.monitoring_parameter:\n"
1038 + " - zxjTestServiceNotAbatract 0\n"
1039 + " - mme_ipu_vdu.monitoring_parameter\n"
1040 + " zxjtestimportserviceab0.imagefile.guest_os:\n"
1041 + " - zxjTestImportServiceAb 0\n"
1042 + " - imagefile.guest_os\n"
1043 + " zxjtestimportserviceab0.imagefile.feature:\n"
1044 + " - zxjTestImportServiceAb 0\n"
1045 + " - imagefile.feature\n"
1046 + " zxjtestservicenotabatract0.imagefile.guest_os:\n"
1047 + " - zxjTestServiceNotAbatract 0\n"
1048 + " - imagefile.guest_os\n"
1049 + " zxjtestimportserviceab0.ipu_cpd.feature:\n"
1050 + " - zxjTestImportServiceAb 0\n"
1051 + " - ipu_cpd.feature\n"
1052 + " zxjtestservicenotabatract0.mme_ipu_vdu.virtualbinding:\n"
1053 + " - zxjTestServiceNotAbatract 0\n"
1054 + " - mme_ipu_vdu.virtualbinding\n"
1055 + " zxjtestimportserviceab0.mme_ipu_vdu.feature:\n"
1056 + " - zxjTestImportServiceAb 0\n"
1057 + " - mme_ipu_vdu.feature\n"
1058 + " extztevl0.feature:\n"
1059 + " - ext ZTE VL 0\n"
1061 + " zxjtestimportserviceab0.imagefile.image_fle:\n"
1062 + " - zxjTestImportServiceAb 0\n"
1063 + " - imagefile.image_fle\n"
1064 + " zxjtestimportserviceab0.mme_ipu_vdu.monitoring_parameter:\n"
1065 + " - zxjTestImportServiceAb 0\n"
1066 + " - mme_ipu_vdu.monitoring_parameter\n"
1067 + " zxjtestservicenotabatract0.ipu_cpd.feature:\n"
1068 + " - zxjTestServiceNotAbatract 0\n"
1069 + " - ipu_cpd.feature\n"
1070 + " zxjtestservicenotabatract0.mme_ipu_vdu.nfv_compute:\n"
1071 + " - zxjTestServiceNotAbatract 0\n"
1072 + " - mme_ipu_vdu.nfv_compute\n"
1073 + " zxjtestservicenotabatract0.mme_ipu_vdu.scalable:\n"
1074 + " - zxjTestServiceNotAbatract 0\n"
1075 + " - mme_ipu_vdu.scalable\n"
1076 + " extcp0.internal_connectionPoint:\n"
1078 + " - internal_connectionPoint\n"
1079 + " zxjtestimportserviceab0.mme_ipu_vdu.virtualbinding:\n"
1080 + " - zxjTestImportServiceAb 0\n"
1081 + " - mme_ipu_vdu.virtualbinding\n"
1082 + " zxjtestservicenotabatract0.imagefile.image_fle:\n"
1083 + " - zxjTestServiceNotAbatract 0\n"
1084 + " - imagefile.image_fle\n"
1085 + " extztevl0.virtual_linkable:\n"
1086 + " - ext ZTE VL 0\n"
1087 + " - virtual_linkable\n"
1088 + " zxjtestservicenotabatract0.imagefile.feature:\n"
1089 + " - zxjTestServiceNotAbatract 0\n"
1090 + " - imagefile.feature\n"
1091 + " zxjtestimportserviceab0.localstorage.feature:\n"
1092 + " - zxjTestImportServiceAb 0\n"
1093 + " - localstorage.feature\n"
1094 + " zxjtestservicenotabatract0.localstorage.local_attachment:\n"
1095 + " - zxjTestServiceNotAbatract 0\n"
1096 + " - localstorage.local_attachment\n"
1097 + " zxjtestimportserviceab0.mme_ipu_vdu.scalable:\n"
1098 + " - zxjTestImportServiceAb 0\n"
1099 + " - mme_ipu_vdu.scalable\n"
1100 + " zxjtestservicenotabatract0.localstorage.feature:\n"
1101 + " - zxjTestServiceNotAbatract 0\n"
1102 + " - localstorage.feature\n"
1103 + " zxjtestimportserviceab0.mme_ipu_vdu.nfv_compute:\n"
1104 + " - zxjTestImportServiceAb 0\n"
1105 + " - mme_ipu_vdu.nfv_compute\n"
1106 + " zxjtestimportserviceab0.localstorage.local_attachment:\n"
1107 + " - zxjTestImportServiceAb 0\n"
1108 + " - localstorage.local_attachment\n"
1109 + " zxjtestservicenotabatract0.mme_ipu_vdu.feature:\n"
1110 + " - zxjTestServiceNotAbatract 0\n"
1111 + " - mme_ipu_vdu.feature\n"
1112 + " zxjtestimportserviceab0.ipu_cpd.forwarder:\n"
1113 + " - zxjTestImportServiceAb 0\n"
1114 + " - ipu_cpd.forwarder\n"
1115 + " zxjtestservicenotabatract0.ipu_cpd.forwarder:\n"
1116 + " - zxjTestServiceNotAbatract 0\n"
1117 + " - ipu_cpd.forwarder\n"
1118 + " requirements:\n"
1119 + " zxjtestservicenotabatract0.imagefile.dependency:\n"
1120 + " - zxjTestServiceNotAbatract 0\n"
1121 + " - imagefile.dependency\n"
1122 + " zxjtestservicenotabatract0.mme_ipu_vdu.local_storage:\n"
1123 + " - zxjTestServiceNotAbatract 0\n"
1124 + " - mme_ipu_vdu.local_storage\n"
1125 + " zxjtestservicenotabatract0.ipu_cpd.dependency:\n"
1126 + " - zxjTestServiceNotAbatract 0\n"
1127 + " - ipu_cpd.dependency\n"
1128 + " zxjtestservicenotabatract0.mme_ipu_vdu.volume_storage:\n"
1129 + " - zxjTestServiceNotAbatract 0\n"
1130 + " - mme_ipu_vdu.volume_storage\n"
1131 + " zxjtestservicenotabatract0.ipu_cpd.virtualbinding:\n"
1132 + " - zxjTestServiceNotAbatract 0\n"
1133 + " - ipu_cpd.virtualbinding\n"
1134 + " zxjtestservicenotabatract0.mme_ipu_vdu.dependency:\n"
1135 + " - zxjTestServiceNotAbatract 0\n"
1136 + " - mme_ipu_vdu.dependency\n"
1137 + " zxjtestservicenotabatract0.localstorage.dependency:\n"
1138 + " - zxjTestServiceNotAbatract 0\n"
1139 + " - localstorage.dependency\n"
1140 + " zxjtestimportserviceab0.imagefile.dependency:\n"
1141 + " - zxjTestImportServiceAb 0\n"
1142 + " - imagefile.dependency\n"
1143 + " zxjtestimportserviceab0.mme_ipu_vdu.volume_storage:\n"
1144 + " - zxjTestImportServiceAb 0\n"
1145 + " - mme_ipu_vdu.volume_storage\n"
1146 + " zxjtestimportserviceab0.ipu_cpd.virtualbinding:\n"
1147 + " - zxjTestImportServiceAb 0\n"
1148 + " - ipu_cpd.virtualbinding\n"
1149 + " extcp0.virtualLink:\n"
1151 + " - virtualLink\n"
1152 + " extcp0.virtualBinding:\n"
1154 + " - virtualBinding\n"
1155 + " zxjtestimportserviceab0.mme_ipu_vdu.guest_os:\n"
1156 + " - zxjTestImportServiceAb 0\n"
1157 + " - mme_ipu_vdu.guest_os\n"
1158 + " extcp0.dependency:\n"
1161 + " zxjtestimportserviceab0.localstorage.dependency:\n"
1162 + " - zxjTestImportServiceAb 0\n"
1163 + " - localstorage.dependency\n"
1164 + " zxjtestservicenotabatract0.ipu_cpd.virtualLink:\n"
1165 + " - zxjTestServiceNotAbatract 0\n"
1166 + " - ipu_cpd.virtualLink\n"
1167 + " extztevl0.dependency:\n"
1168 + " - ext ZTE VL 0\n"
1170 + " zxjtestimportserviceab0.ipu_cpd.dependency:\n"
1171 + " - zxjTestImportServiceAb 0\n"
1172 + " - ipu_cpd.dependency\n"
1173 + " zxjtestimportserviceab0.mme_ipu_vdu.dependency:\n"
1174 + " - zxjTestImportServiceAb 0\n"
1175 + " - mme_ipu_vdu.dependency\n"
1176 + " zxjtestimportserviceab0.mme_ipu_vdu.local_storage:\n"
1177 + " - zxjTestImportServiceAb 0\n"
1178 + " - mme_ipu_vdu.local_storage\n"
1179 + " zxjtestimportserviceab0.ipu_cpd.virtualLink:\n"
1180 + " - zxjTestImportServiceAb 0\n"
1181 + " - ipu_cpd.virtualLink\n"
1182 + " extcp0.external_virtualLink:\n"
1184 + " - external_virtualLink\n"
1185 + " zxjtestservicenotabatract0.mme_ipu_vdu.guest_os:\n"
1186 + " - zxjTestServiceNotAbatract 0\n"
1187 + " - mme_ipu_vdu.guest_os\n"
1188 + " zxjtestimportserviceab0.ipu_cpd.forwarder:\n"
1189 + " - zxjTestImportServiceAb 0\n"
1190 + " - ipu_cpd.forwarder\n"
1191 + " zxjtestservicenotabatract0.ipu_cpd.forwarder:\n"
1192 + " - zxjTestServiceNotAbatract 0\n"
1193 + " - ipu_cpd.forwarder\n";
1196 protected void assertComponentException(ComponentException e, ActionStatus expectedStatus, String... variables) {
1197 ResponseFormat actualResponse = e.getResponseFormat() != null ?
1198 e.getResponseFormat() : componentsUtils.getResponseFormat(e.getActionStatus(), e.getParams());
1199 assertResponse(actualResponse, expectedStatus, variables);
1202 protected void assertResponse(ResponseFormat actualResponse, ActionStatus expectedStatus, String... variables) {
1203 ResponseFormat expectedResponse = responseManager.getResponseFormat(expectedStatus, variables);
1204 assertEquals(expectedResponse.getStatus(), actualResponse.getStatus());
1205 assertEquals("assert error description", expectedResponse.getFormattedMessage(), actualResponse.getFormattedMessage());