Add test code for Test Topology Auto Design
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / components / impl / ServiceImportBussinessLogicBaseTestSetup.java
index 928dbf9..a56114a 100644 (file)
@@ -1,49 +1,22 @@
 /*
-
- * Copyright (c) 2018 AT&T Intellectual Property.
-
+ * Copyright (C) 2020 CMCC, Inc. and others. All rights reserved.
  *
-
  * Licensed under the Apache License, Version 2.0 (the "License");
-
  * you may not use this file except in compliance with the License.
-
  * You may obtain a copy of the License at
-
  *
-
  *     http://www.apache.org/licenses/LICENSE-2.0
-
  *
-
  * Unless required by applicable law or agreed to in writing, software
-
  * distributed under the License is distributed on an "AS IS" BASIS,
-
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
  * See the License for the specific language governing permissions and
-
  * limitations under the License.
-
  */
-
 package org.openecomp.sdc.be.components.impl;
 
 import fj.data.Either;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Before;
-import org.mockito.Mock;
+import org.junit.jupiter.api.BeforeEach;
 import org.mockito.Mockito;
 import org.openecomp.sdc.ElementOperationMock;
 import org.openecomp.sdc.be.auditing.impl.AuditingManager;
@@ -61,7 +34,6 @@ import org.openecomp.sdc.be.components.validation.component.*;
 import org.openecomp.sdc.be.components.validation.service.*;
 import org.openecomp.sdc.be.dao.api.ActionStatus;
 import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
 import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao;
 import org.openecomp.sdc.be.datamodel.utils.UiComponentDataConverter;
 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
@@ -79,7 +51,6 @@ import org.openecomp.sdc.be.model.operations.api.IElementOperation;
 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation;
 import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
-import org.openecomp.sdc.be.servlets.AbstractValidationsServlet;
 import org.openecomp.sdc.be.user.Role;
 import org.openecomp.sdc.be.user.UserBusinessLogic;
 import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
@@ -89,10 +60,13 @@ import org.openecomp.sdc.exception.ResponseFormat;
 import org.springframework.web.context.WebApplicationContext;
 
 import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 
-import static org.assertj.core.api.Java6Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.*;
 import static org.mockito.Mockito.when;
 
@@ -174,8 +148,8 @@ public class ServiceImportBussinessLogicBaseTestSetup extends BaseBusinessLogicM
         return new ServiceValidator(componentsUtils, componentFieldValidators, serviceFieldValidators);
     }
 
-    @Before
-    public void setup() {
+    @BeforeEach
+    public void setup() throws IOException {
 
         // Elements
         IElementOperation mockElementDao = new ElementOperationMock();
@@ -436,6 +410,7 @@ protected Resource createParseResourceObject(boolean afterCreate) {
         List<UploadReqInfo> uploadReqInfoList = new ArrayList<>();
         UploadReqInfo uploadReqInfo = new UploadReqInfo();
         uploadReqInfo.setName("uploadReqInfo");
+        uploadReqInfo.setNode("zxjTestImportServiceAb");
         uploadReqInfo.setCapabilityName("tosca.capabilities.Node");
         uploadReqInfoList.add(uploadReqInfo);
         requirements.put("requirements",uploadReqInfoList);
@@ -488,7 +463,7 @@ protected Resource createParseResourceObject(boolean afterCreate) {
         return uploadComponentInstanceInfo;
     }
 
-    private void mockAbstract() {
+    private void mockAbstract() throws IOException {
         checkCreateAbstract();
         checkCreateOther();
         checkCreateFile();
@@ -629,7 +604,7 @@ protected Resource createParseResourceObject(boolean afterCreate) {
         uploadServiceInfo.getPayloadData();
     }
 
-    private void checkCreateFile(){
+    private void checkCreateFile() throws IOException {
         CreateServiceFromYamlParameter csfp = new CreateServiceFromYamlParameter();
         Map<String, NodeTypeInfo> nodeTypesInfo = new HashMap<>();
         ParsedToscaYamlInfo parsedToscaYamlInfo = new ParsedToscaYamlInfo();
@@ -657,8 +632,7 @@ protected Resource createParseResourceObject(boolean afterCreate) {
         getCsfy.getNodeName();
     }
 
-    protected CsarInfo getCsarInfo ()
-    {
+    protected CsarInfo getCsarInfo () throws IOException {
         String csarUuid = "0010";
         User user = new User();
         Map<String, byte[]> csar = crateCsarFromPayload();
@@ -679,518 +653,28 @@ protected Resource createParseResourceObject(boolean afterCreate) {
         return returnValue;
     }
 
-    protected String getGroupsYaml(){
-        return "zxjTestImportServiceAb 0:\n" +
-                "      type: org.openecomp.resource.vf.Zxjtestimportserviceab\n" +
-                "      metadata:\n" +
-                "        invariantUUID: 41474f7f-3195-443d-a0a2-eb6020a56279\n" +
-                "        UUID: 92e32e49-55f8-46bf-984d-a98c924037ec\n" +
-                "        customizationUUID: 40286158-96d0-408e-9f27-21d43817d37c\n" +
-                "        version: '1.0'\n" +
-                "        name: zxjTestImportServiceAb\n" +
-                "        description: zxjTestImportServiceAbstract\n" +
-                "        type: VF\n" +
-                "        category: Generic\n" +
-                "        subcategory: Abstract\n" +
-                "        resourceVendor: zxjImportService\n" +
-                "        resourceVendorRelease: '1.0'\n" +
-                "        resourceVendorModelNumber: ''\n" +
-                "      properties:\n" +
-                "        skip_post_instantiation_configuration: true\n" +
-                "        nf_naming:\n" +
-                "          ecomp_generated_naming: true\n" +
-                "        multi_stage_design: 'false'\n" +
-                "        controller_actor: SO-REF-DATA\n" +
-                "        availability_zone_max_count: 1\n" +
-                "      requirements:\n" +
-                "      - imagefile.dependency:\n" +
-                "          capability: feature\n" +
-                "          node: ext ZTE VL 0\n" +
-                "      - mme_ipu_vdu.dependency:\n" +
-                "          capability: feature\n" +
-                "          node: ExtCP 0\n" +
-                "      capabilities:\n" +
-                "        mme_ipu_vdu.scalable:\n" +
-                "          properties:\n" +
-                "            max_instances: 1\n" +
-                "            min_instances: 1\n" +
-                "        mme_ipu_vdu.nfv_compute:\n" +
-                "          properties:\n" +
-                "            num_cpus: '2'\n" +
-                "            flavor_extra_specs: {\n" +
-                "              }\n" +
-                "            mem_size: '8192'";
+    protected String getGroupsYaml() throws IOException {
+        Path filePath = Paths.get("src/test/resources/types/groups.yml");
+        byte[] fileContent = Files.readAllBytes(filePath);
+        return new String(fileContent);
+    }
+
+    protected String getYamlFileContent() throws IOException {
+        Path filePath = Paths.get("src/test/resources/types/fileContent.yml");
+        byte[] fileContent = Files.readAllBytes(filePath);
+        return new String(fileContent);
     }
 
-    protected String getYamlFileContent(){
-        return "tosca_definitions_version: tosca_simple_yaml_1_1\n" +
-                "imports:\n" +
-                "- data.yml\n" +
-                "group_types:\n" +
-                "  tosca.groups.Root:\n" +
-                "    description: The TOSCA Group Type all other TOSCA Group Types derive from\n" +
-                "    interfaces:\n" +
-                "      Standard:\n" +
-                "        type: tosca.interfaces.node.lifecycle.Standard\n" +
-                "  org.openecomp.groups.heat.HeatStack:\n" +
-                "    derived_from: tosca.groups.Root\n" +
-                "    description: Grouped all heat resources which are in the same heat stack\n" +
-                "    properties:\n" +
-                "      heat_file:\n" +
-                "        type: string\n" +
-                "        description: Heat file which associate to this group/heat stack\n" +
-                "        required: true\n" +
-                "        status: supported\n" +
-                "      description:\n" +
-                "        type: string\n" +
-                "        description: group description\n" +
-                "        required: true\n" +
-                "        status: supported\n" +
-                "  org.openecomp.groups.VfModule:\n" +
-                "    derived_from: tosca.groups.Root\n" +
-                "    description: Grouped all heat resources which are in the same VF Module\n" +
-                "    properties:\n" +
-                "      isBase:\n" +
-                "        type: boolean\n" +
-                "        description: Whether this module should be deployed before other modules\n" +
-                "        required: true\n" +
-                "        default: false\n" +
-                "        status: supported\n" +
-                "      vf_module_label:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: |\n" +
-                "          Alternate textual key used to reference this VF-Module model. Must be unique within the VNF model\n" +
-                "      vf_module_description:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: |\n" +
-                "          Description of the VF-modules contents and purpose (e.g. \"Front-End\" or \"Database Cluster\")\n" +
-                "      min_vf_module_instances:\n" +
-                "        type: integer\n" +
-                "        required: true\n" +
-                "        description: The minimum instances of this VF-Module\n" +
-                "      max_vf_module_instances:\n" +
-                "        type: integer\n" +
-                "        required: false\n" +
-                "        description: The maximum instances of this VF-Module\n" +
-                "      initial_count:\n" +
-                "        type: integer\n" +
-                "        required: false\n" +
-                "        description: |\n" +
-                "          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" +
-                "      vf_module_type:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        constraint:\n" +
-                "        - valid_values:\n" +
-                "          - Base\n" +
-                "          - Expansion\n" +
-                "      volume_group:\n" +
-                "        type: boolean\n" +
-                "        required: true\n" +
-                "        default: false\n" +
-                "        description: |\n" +
-                "          \"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" +
-                "      availability_zone_count:\n" +
-                "        type: integer\n" +
-                "        required: false\n" +
-                "        description: |\n" +
-                "          Quantity of Availability Zones needed for this VF-Module (source: Extracted from VF-Module HEAT template)\n" +
-                "      vfc_list:\n" +
-                "        type: map\n" +
-                "        entry_schema:\n" +
-                "          description: <vfc_id>:<count>\n" +
-                "          type: string\n" +
-                "        required: false\n" +
-                "        description: |\n" +
-                "          Identifies the set of VM types and their count included in the VF-Module\n" +
-                "  org.openecomp.groups.NetworkCollection:\n" +
-                "    derived_from: tosca.groups.Root\n" +
-                "    description: groups l3-networks in network collection\n" +
-                "    properties:\n" +
-                "      network_collection_function:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: network collection function\n" +
-                "      network_collection_description:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: network collection description, free format text\n" +
-                "  org.openecomp.groups.VfcInstanceGroup:\n" +
-                "    derived_from: tosca.groups.Root\n" +
-                "    description: groups VFCs with same parent port role\n" +
-                "    properties:\n" +
-                "      vfc_instance_group_function:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: function of this VFC group\n" +
-                "      vfc_parent_port_role:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: common role of parent ports of VFCs in this group\n" +
-                "      network_collection_function:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: network collection function assigned to this group\n" +
-                "      subinterface_role:\n" +
-                "        type: string\n" +
-                "        required: true\n" +
-                "        description: common role of subinterfaces of VFCs in this group, criteria the group is created\n" +
-                "    capabilities:\n" +
-                "      vlan_assignment:\n" +
-                "        type: org.openecomp.capabilities.VLANAssignment\n" +
-                "        properties:\n" +
-                "          vfc_instance_group_reference:\n" +
-                "            type: string\n" +
-                "  tosca.groups.nfv.PlacementGroup:\n" +
-                "    derived_from: tosca.groups.Root\n" +
-                "    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" +
-                "    properties:\n" +
-                "      description:\n" +
-                "        type: string\n" +
-                "        description: Human readable description of the group\n" +
-                "        required: true\n" +
-                "    members:\n" +
-                "    - tosca.nodes.nfv.Vdu.Compute\n" +
-                "    - tosca.nodes.nfv.VnfVirtualLink";
+    public String getMainTemplateContent() throws IOException {
+        Path filePath = Paths.get("src/test/resources/types/mainTemplateContent.yml");
+        byte[] fileContent = Files.readAllBytes(filePath);
+        return new String(fileContent);
     }
 
-    public String getMainTemplateContent(){
-        return "tosca_definitions_version: tosca_simple_yaml_1_1\n"
-                + "metadata:\n"
-                + "  invariantUUID: 6d17f281-683b-4198-a676-0faeecdc9025\n"
-                + "  UUID: bfeab6b4-199b-4a2b-b724-de416c5e9811\n"
-                + "  name: ser09080002\n"
-                + "  description: ser09080002\n"
-                + "  type: Service\n"
-                + "  category: E2E Service\n"
-                + "  serviceType: ''\n"
-                + "  serviceRole: ''\n"
-                + "  instantiationType: A-la-carte\n"
-                + "  serviceEcompNaming: true\n"
-                + "  ecompGeneratedNaming: true\n"
-                + "  namingPolicy: ''\n"
-                + "  environmentContext: General_Revenue-Bearing\n"
-                + "  serviceFunction: ''\n"
-                + "imports:\n"
-                + "- nodes:\n"
-                + "    file: nodes.yml\n"
-                + "- datatypes:\n"
-                + "    file: data.yml\n"
-                + "- capabilities:\n"
-                + "    file: capabilities.yml\n"
-                + "- relationships:\n"
-                + "    file: relationships.yml\n"
-                + "- groups:\n"
-                + "    file: groups.yml\n"
-                + "- policies:\n"
-                + "    file: policies.yml\n"
-                + "- annotations:\n"
-                + "    file: annotations.yml\n"
-                + "- service-ser09080002-interface:\n"
-                + "    file: service-Ser09080002-template-interface.yml\n"
-                + "- resource-ExtCP:\n"
-                + "    file: resource-Extcp-template.yml\n"
-                + "- resource-zxjTestImportServiceAb:\n"
-                + "    file: resource-Zxjtestimportserviceab-template.yml\n"
-                + "- resource-zxjTestImportServiceAb-interface:\n"
-                + "    file: resource-Zxjtestimportserviceab-template-interface.yml\n"
-                + "- resource-zxjTestServiceNotAbatract:\n"
-                + "    file: resource-Zxjtestservicenotabatract-template.yml\n"
-                + "- resource-zxjTestServiceNotAbatract-interface:\n"
-                + "    file: resource-Zxjtestservicenotabatract-template-interface.yml\n"
-                + "- resource-ext ZTE VL:\n"
-                + "    file: resource-ExtZteVl-template.yml\n"
-                + "topology_template:\n"
-                + "  inputs:\n"
-                + "    skip_post_instantiation_configuration:\n"
-                + "      default: true\n"
-                + "      type: boolean\n"
-                + "      required: false\n"
-                + "    controller_actor:\n"
-                + "      default: SO-REF-DATA\n"
-                + "      type: string\n"
-                + "      required: false\n"
-                + "    cds_model_version:\n"
-                + "      type: string\n"
-                + "      required: false\n"
-                + "    cds_model_name:\n"
-                + "      type: string\n"
-                + "      required: false\n"
-                + "  node_templates:\n"
-                + "    ext ZTE VL 0:\n"
-                + "      type: tosca.nodes.nfv.ext.zte.VL\n"
-                + "      metadata:\n"
-                + "        invariantUUID: 27ab7610-1a97-4daa-938a-3b48e7afcfd0\n"
-                + "        UUID: 9ea63e2c-4b8a-414f-93e3-5703ca5cee0d\n"
-                + "        customizationUUID: e45e79b0-07ab-46b4-ac26-1e9f155ce53c\n"
-                + "        version: '1.0'\n"
-                + "        name: ext ZTE VL\n"
-                + "        description: Ext ZTE VL\n"
-                + "        type: VL\n"
-                + "        category: Generic\n"
-                + "        subcategory: Network Elements\n"
-                + "        resourceVendor: ONAP (Tosca)\n"
-                + "        resourceVendorRelease: 1.0.0.wd03\n"
-                + "        resourceVendorModelNumber: ''\n"
-                + "    zxjTestServiceNotAbatract 0:\n"
-                + "      type: org.openecomp.resource.vf.Zxjtestservicenotabatract\n"
-                + "      metadata:\n"
-                + "        invariantUUID: ce39ce8d-6f97-4e89-8555-ae6789cdcf1c\n"
-                + "        UUID: 4ac822be-f1ae-4ace-a4b8-bf6b5d977005\n"
-                + "        customizationUUID: ee34e1e8-68e2-480f-8ba6-f257bbe90d6a\n"
-                + "        version: '1.0'\n"
-                + "        name: zxjTestServiceNotAbatract\n"
-                + "        description: zxjTestServiceNotAbatract\n"
-                + "        type: VF\n"
-                + "        category: Network L4+\n"
-                + "        subcategory: Common Network Resources\n"
-                + "        resourceVendor: zxjImportService\n"
-                + "        resourceVendorRelease: '1.0'\n"
-                + "        resourceVendorModelNumber: ''\n"
-                + "      properties:\n"
-                + "        nf_naming:\n"
-                + "          ecomp_generated_naming: true\n"
-                + "        skip_post_instantiation_configuration: true\n"
-                + "        multi_stage_design: 'false'\n"
-                + "        controller_actor: SO-REF-DATA\n"
-                + "        availability_zone_max_count: 1\n"
-                + "      capabilities:\n"
-                + "        mme_ipu_vdu.scalable:\n"
-                + "          properties:\n"
-                + "            max_instances: 1\n"
-                + "            min_instances: 1\n"
-                + "        mme_ipu_vdu.nfv_compute:\n"
-                + "          properties:\n"
-                + "            num_cpus: '2'\n"
-                + "            flavor_extra_specs: {\n"
-                + "              }\n"
-                + "            mem_size: '8192'\n"
-                + "    ExtCP 0:\n"
-                + "      type: org.openecomp.resource.cp.extCP\n"
-                + "      metadata:\n"
-                + "        invariantUUID: 9b772728-93f5-424f-bb07-f4cae2783614\n"
-                + "        UUID: 424ac220-4864-453e-b757-917fe4568ff8\n"
-                + "        customizationUUID: 6e65d8a8-4379-4693-87aa-82f9e34b92fd\n"
-                + "        version: '1.0'\n"
-                + "        name: ExtCP\n"
-                + "        description: The AT&T Connection Point base type all other CP derive from\n"
-                + "        type: CP\n"
-                + "        category: Generic\n"
-                + "        subcategory: Network Elements\n"
-                + "        resourceVendor: ONAP (Tosca)\n"
-                + "        resourceVendorRelease: 1.0.0.wd03\n"
-                + "        resourceVendorModelNumber: ''\n"
-                + "      properties:\n"
-                + "        mac_requirements:\n"
-                + "          mac_count_required:\n"
-                + "            is_required: false\n"
-                + "        exCP_naming:\n"
-                + "          ecomp_generated_naming: true\n"
-                + "    zxjTestImportServiceAb 0:\n"
-                + "      type: org.openecomp.resource.vf.Zxjtestimportserviceab\n"
-                + "      metadata:\n"
-                + "        invariantUUID: 41474f7f-3195-443d-a0a2-eb6020a56279\n"
-                + "        UUID: 92e32e49-55f8-46bf-984d-a98c924037ec\n"
-                + "        customizationUUID: 98c7a6c7-a867-45fb-8597-dd464f98e4aa\n"
-                + "        version: '1.0'\n"
-                + "        name: zxjTestImportServiceAb\n"
-                + "        description: zxjTestImportServiceAbstract\n"
-                + "        type: VF\n"
-                + "        category: Generic\n"
-                + "        subcategory: Abstract\n"
-                + "        resourceVendor: zxjImportService\n"
-                + "        resourceVendorRelease: '1.0'\n"
-                + "        resourceVendorModelNumber: ''\n"
-                + "      properties:\n"
-                + "        nf_naming:\n"
-                + "          ecomp_generated_naming: true\n"
-                + "        skip_post_instantiation_configuration: true\n"
-                + "        multi_stage_design: 'false'\n"
-                + "        controller_actor: SO-REF-DATA\n"
-                + "        availability_zone_max_count: 1\n"
-                + "      requirements:\n"
-                + "      - mme_ipu_vdu.dependency:\n"
-                + "          capability: feature\n"
-                + "          node: ExtCP 0\n"
-                + "      - imagefile.dependency:\n"
-                + "          capability: feature\n"
-                + "          node: ext ZTE VL 0\n"
-                + "      capabilities:\n"
-                + "        mme_ipu_vdu.scalable:\n"
-                + "          properties:\n"
-                + "            max_instances: 1\n"
-                + "            min_instances: 1\n"
-                + "        mme_ipu_vdu.nfv_compute:\n"
-                + "          properties:\n"
-                + "            num_cpus: '2'\n"
-                + "            flavor_extra_specs: {\n"
-                + "              }\n"
-                + "            mem_size: '8192'\n"
-                + "  substitution_mappings:\n"
-                + "    node_type: org.openecomp.service.Ser09080002\n"
-                + "    capabilities:\n"
-                + "      extcp0.feature:\n"
-                + "      - ExtCP 0\n"
-                + "      - feature\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.monitoring_parameter:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.monitoring_parameter\n"
-                + "      zxjtestimportserviceab0.imagefile.guest_os:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - imagefile.guest_os\n"
-                + "      zxjtestimportserviceab0.imagefile.feature:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - imagefile.feature\n"
-                + "      zxjtestservicenotabatract0.imagefile.guest_os:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - imagefile.guest_os\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.feature:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.feature\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.virtualbinding:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.virtualbinding\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.feature:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.feature\n"
-                + "      extztevl0.feature:\n"
-                + "      - ext ZTE VL 0\n"
-                + "      - feature\n"
-                + "      zxjtestimportserviceab0.imagefile.image_fle:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - imagefile.image_fle\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.monitoring_parameter:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.monitoring_parameter\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.feature:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.feature\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.nfv_compute:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.nfv_compute\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.scalable:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.scalable\n"
-                + "      extcp0.internal_connectionPoint:\n"
-                + "      - ExtCP 0\n"
-                + "      - internal_connectionPoint\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.virtualbinding:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.virtualbinding\n"
-                + "      zxjtestservicenotabatract0.imagefile.image_fle:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - imagefile.image_fle\n"
-                + "      extztevl0.virtual_linkable:\n"
-                + "      - ext ZTE VL 0\n"
-                + "      - virtual_linkable\n"
-                + "      zxjtestservicenotabatract0.imagefile.feature:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - imagefile.feature\n"
-                + "      zxjtestimportserviceab0.localstorage.feature:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - localstorage.feature\n"
-                + "      zxjtestservicenotabatract0.localstorage.local_attachment:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - localstorage.local_attachment\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.scalable:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.scalable\n"
-                + "      zxjtestservicenotabatract0.localstorage.feature:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - localstorage.feature\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.nfv_compute:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.nfv_compute\n"
-                + "      zxjtestimportserviceab0.localstorage.local_attachment:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - localstorage.local_attachment\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.feature:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.feature\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.forwarder:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.forwarder\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.forwarder:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.forwarder\n"
-                + "    requirements:\n"
-                + "      zxjtestservicenotabatract0.imagefile.dependency:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - imagefile.dependency\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.local_storage:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.local_storage\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.dependency:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.dependency\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.volume_storage:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.volume_storage\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.virtualbinding:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.virtualbinding\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.dependency:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.dependency\n"
-                + "      zxjtestservicenotabatract0.localstorage.dependency:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - localstorage.dependency\n"
-                + "      zxjtestimportserviceab0.imagefile.dependency:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - imagefile.dependency\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.volume_storage:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.volume_storage\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.virtualbinding:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.virtualbinding\n"
-                + "      extcp0.virtualLink:\n"
-                + "      - ExtCP 0\n"
-                + "      - virtualLink\n"
-                + "      extcp0.virtualBinding:\n"
-                + "      - ExtCP 0\n"
-                + "      - virtualBinding\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.guest_os:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.guest_os\n"
-                + "      extcp0.dependency:\n"
-                + "      - ExtCP 0\n"
-                + "      - dependency\n"
-                + "      zxjtestimportserviceab0.localstorage.dependency:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - localstorage.dependency\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.virtualLink:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.virtualLink\n"
-                + "      extztevl0.dependency:\n"
-                + "      - ext ZTE VL 0\n"
-                + "      - dependency\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.dependency:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.dependency\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.dependency:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.dependency\n"
-                + "      zxjtestimportserviceab0.mme_ipu_vdu.local_storage:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - mme_ipu_vdu.local_storage\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.virtualLink:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.virtualLink\n"
-                + "      extcp0.external_virtualLink:\n"
-                + "      - ExtCP 0\n"
-                + "      - external_virtualLink\n"
-                + "      zxjtestservicenotabatract0.mme_ipu_vdu.guest_os:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - mme_ipu_vdu.guest_os\n"
-                + "      zxjtestimportserviceab0.ipu_cpd.forwarder:\n"
-                + "      - zxjTestImportServiceAb 0\n"
-                + "      - ipu_cpd.forwarder\n"
-                + "      zxjtestservicenotabatract0.ipu_cpd.forwarder:\n"
-                + "      - zxjTestServiceNotAbatract 0\n"
-                + "      - ipu_cpd.forwarder\n";
+    protected String getArtifactsYml() throws IOException {
+        Path filePath = Paths.get("src/test/resources/types/artifacts.yml");
+        byte[] fileContent = Files.readAllBytes(filePath);
+        return new String(fileContent);
     }
 
     protected void assertComponentException(ComponentException e, ActionStatus expectedStatus, String... variables) {