Unable to import service template with interface
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / components / impl / ServiceImportBusinessLogicTest.java
index ee52431..47be73a 100644 (file)
 
 package org.openecomp.sdc.be.components.impl;
 
-
 import static org.assertj.core.api.Java6Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyBoolean;
 import static org.mockito.Mockito.anyList;
 import static org.mockito.Mockito.anyMap;
-import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.contains;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.isNull;
+import static org.mockito.Mockito.matches;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.components.impl.ServiceImportBusinessLogic.CREATE_RESOURCE;
 
 import fj.data.Either;
+import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.net.URISyntaxException;
 import java.nio.file.FileSystems;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.collections.map.HashedMap;
 import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.json.simple.JSONObject;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
 import org.mockito.InjectMocks;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.openecomp.sdc.be.components.csar.CsarBusinessLogic;
 import org.openecomp.sdc.be.components.csar.CsarInfo;
+import org.openecomp.sdc.be.components.csar.ServiceCsarInfo;
 import org.openecomp.sdc.be.components.impl.artifact.ArtifactOperationInfo;
 import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
 import org.openecomp.sdc.be.components.impl.utils.CreateServiceFromYamlParameter;
@@ -63,14 +74,16 @@ import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
 import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaGetFunctionType;
 import org.openecomp.sdc.be.externalapi.servlet.ArtifactExternalServlet;
-import org.openecomp.sdc.be.impl.ComponentsUtils;
 import org.openecomp.sdc.be.impl.ServletUtils;
 import org.openecomp.sdc.be.info.NodeTypeInfoToUpdateArtifacts;
 import org.openecomp.sdc.be.model.ArtifactDefinition;
 import org.openecomp.sdc.be.model.AttributeDefinition;
 import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.CapabilityTypeDefinition;
 import org.openecomp.sdc.be.model.Component;
 import org.openecomp.sdc.be.model.ComponentInstance;
 import org.openecomp.sdc.be.model.ComponentInstanceInput;
@@ -79,6 +92,7 @@ import org.openecomp.sdc.be.model.ComponentMetadataDefinition;
 import org.openecomp.sdc.be.model.ComponentParametersView;
 import org.openecomp.sdc.be.model.DataTypeDefinition;
 import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupTypeDefinition;
 import org.openecomp.sdc.be.model.IPropertyInputCommon;
 import org.openecomp.sdc.be.model.InputDefinition;
 import org.openecomp.sdc.be.model.InterfaceDefinition;
@@ -93,146 +107,310 @@ import org.openecomp.sdc.be.model.RequirementDefinition;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.UploadComponentInstanceInfo;
+import org.openecomp.sdc.be.model.UploadNodeFilterInfo;
 import org.openecomp.sdc.be.model.UploadPropInfo;
 import org.openecomp.sdc.be.model.UploadReqInfo;
 import org.openecomp.sdc.be.model.UploadResourceInfo;
 import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
+import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
 import org.openecomp.sdc.be.model.operations.api.ICapabilityTypeOperation;
 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
+import org.openecomp.sdc.be.model.operations.impl.ArtifactTypeOperation;
+import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation;
+import org.openecomp.sdc.be.model.operations.impl.GroupTypeOperation;
+import org.openecomp.sdc.be.model.operations.impl.ModelOperation;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
 import org.openecomp.sdc.be.servlets.AbstractValidationsServlet;
 import org.openecomp.sdc.be.tosca.CsarUtils;
-import org.openecomp.sdc.be.user.UserBusinessLogic;
+import org.openecomp.sdc.be.tosca.ToscaExportHandler;
 import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
 import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.zip.ZipUtils;
+import org.openecomp.sdc.common.zip.exception.ZipException;
 import org.openecomp.sdc.exception.ResponseFormat;
+import org.yaml.snakeyaml.Yaml;
 
 class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTestSetup {
-    private final static String DEFAULT_ICON = "defaulticon";
-
-    @InjectMocks
-    static ServiceImportBusinessLogic serviceImportBusinessLogic;
 
-    ServiceBusinessLogic serviceBusinessLogic = Mockito.mock(ServiceBusinessLogic.class);
-    CsarBusinessLogic csarBusinessLogic = Mockito.mock(CsarBusinessLogic.class);
-    ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class);
-    ServiceImportParseLogic serviceImportParseLogic = Mockito.mock(ServiceImportParseLogic.class);
-    ArtifactDefinition artifactDefinition = Mockito.mock(ArtifactDefinition.class);
+    private final ArtifactDefinition artifactDefinition = mock(ArtifactDefinition.class);
+    private final ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
+    private final ServletUtils servletUtils = mock(ServletUtils.class);
+    private final AbstractValidationsServlet servlet = new ArtifactExternalServlet(
+        componentInstanceBusinessLogic, componentsUtils, servletUtils, resourceImportManager, artifactsBusinessLogic);
+    private final ApplicationDataTypeCache applicationDataTypeCache = mock(ApplicationDataTypeCache.class);
+    private final ArtifactTypeOperation artifactTypeOperation = mock(ArtifactTypeOperation.class);
+    private final DataTypeBusinessLogic dataTypeBusinessLogic = mock(DataTypeBusinessLogic.class);
+    private final ArtifactTypeImportManager artifactTypeImportManager = mock(ArtifactTypeImportManager.class);
+    private final GroupTypeOperation groupTypeOperation = mock(GroupTypeOperation.class);
+    private final CapabilityTypeOperation capabilityTypeOperation = mock(CapabilityTypeOperation.class);
+    private final CapabilityTypeImportManager capabilityTypeImportManager = mock(CapabilityTypeImportManager.class);
+    private final InterfaceLifecycleTypeImportManager interfaceLifecycleTypeImportManager = mock(InterfaceLifecycleTypeImportManager.class);
 
+    @InjectMocks
+    private ServiceImportBusinessLogic sIBL;
 
-    private static UserBusinessLogic userBusinessLogic = Mockito.mock(UserBusinessLogic.class);
-    private static ComponentInstanceBusinessLogic componentInstanceBusinessLogic = Mockito.mock(ComponentInstanceBusinessLogic.class);
-    private static final ComponentsUtils componentsUtils = Mockito.mock(ComponentsUtils.class);
-    private static ServletUtils servletUtils = mock(ServletUtils.class);
-    private static ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
-    private static ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class);
+    public static String loadFileNameToJsonString(String fileName) throws IOException {
+        String sourceDir = "src/test/resources/normativeTypes";
+        return loadFileNameToJsonString(sourceDir, fileName);
+    }
 
-    private static AbstractValidationsServlet servlet = new ArtifactExternalServlet(userBusinessLogic,
-            componentInstanceBusinessLogic, componentsUtils, servletUtils, resourceImportManager, artifactsBusinessLogic);
+    private static String loadFileNameToJsonString(String sourceDir, String fileName) throws IOException {
+        java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir, fileName);
+        byte[] fileContent = Files.readAllBytes(filePath);
+        return new String(fileContent);
+    }
 
     @BeforeEach
-    public void initMocks() {
-        MockitoAnnotations.initMocks(this);
+    void initMocks() {
+        MockitoAnnotations.openMocks(this);
         when(artifactDefinition.getMandatory()).thenReturn(true);
         when(artifactDefinition.getArtifactName()).thenReturn("creatorFullName");
         when(artifactDefinition.getArtifactType()).thenReturn("TOSCA_CSAR");
-
-        sIB1.setServiceBusinessLogic(serviceBusinessLogic);
-        sIB1.setCsarBusinessLogic(csarBusinessLogic);
-        sIB1.setServiceImportParseLogic(serviceImportParseLogic);
-        sIB1.setToscaOperationFacade(toscaOperationFacade);
-        sIB1.setComponentsUtils(componentsUtils);
-        sIB1.setCsarArtifactsAndGroupsBusinessLogic(csarArtifactsAndGroupsBusinessLogic);
-
-    }
-
-    @Test
-    public void testGetComponentsUtils() {
-        ComponentsUtils result;
-        result = serviceImportBusinessLogic.getComponentsUtils();
-
     }
 
     @Test
-    public void testSetComponentsUtils() {
-        ComponentsUtils componentsUtils = null;
+    void testCreateService_OK() {
+        Service oldService = createServiceObject(true);
+        oldService.setComponentInstances(creatComponentInstances());
+        oldService.setComponentInstancesProperties(
+            Collections.singletonMap(COMPONENT_ID, Collections.singletonList(new ComponentInstanceProperty())));
+        String payloadName = "valid_vf";
+        Map<String, byte[]> payload = crateCsarFromPayload();
+        Service newService = createServiceObject(true);
+        newService.setComponentInstances(creatComponentInstances());
+        ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty();
+        componentInstanceProperty.setName("propertiesName");
+        final JSONObject jsonObject = new JSONObject();
+        jsonObject.put(ToscaGetFunctionType.GET_INPUT.getFunctionName(), "zxjTestImportServiceAb_propertiesName");
+        componentInstanceProperty.setValue(jsonObject.toJSONString());
 
+        Map<String, ArtifactDefinition> toscaArtifacts = new HashMap<>();
+        ArtifactDefinition artifactDef = new ArtifactDefinition();
+        String artifactUniqueId = "test_extcp_resource.assettoscatemplate";
+        artifactDef.setUniqueId(artifactUniqueId);
+        toscaArtifacts.put(ToscaExportHandler.ASSET_TOSCA_TEMPLATE, artifactDef);
+        Resource resource = new Resource();
+        String resourceUniqueId = "extcp_resource";
+        resource.setUniqueId(resourceUniqueId);
+        resource.setToscaArtifacts(toscaArtifacts);
+        resource.getComponentMetadataDefinition().getMetadataDataDefinition().setState(LifecycleStateEnum.CERTIFIED.name());
+        resource.setResourceType(ResourceTypeEnum.VF);
 
-        assertNotNull(serviceImportBusinessLogic);
+        ImmutablePair<String, byte[]> resourceTemplate = getNodeType();
+        String updatedNodeType = "org.openecomp.resource.cp.extCP";
+        resource.setToscaResourceName(updatedNodeType);
 
-    }
+        newService.setComponentInstancesProperties(
+            Collections.singletonMap(COMPONENT_ID + "." + "zxjTestImportServiceAb", Collections.singletonList(componentInstanceProperty)));
+        newService.setProperties(getProperties());
 
-    @Test
-    public void testCreateService() {
+        when(serviceBusinessLogic.validateServiceBeforeCreate(eq(newService), any(User.class), any(AuditingActionEnum.class)))
+            .thenReturn(Either.left(newService));
+        when(toscaOperationFacade.validateCsarUuidUniqueness(anyString())).thenReturn(StorageOperationStatus.OK);
+        ServiceCsarInfo csarInfo = getCsarInfo();
+        when(csarBusinessLogic.getCsarInfo(any(Service.class), any(), any(User.class), any(Map.class), anyString(), any())).thenReturn(csarInfo);
+        when(serviceImportParseLogic.findNodeTypesArtifactsToHandle(any(Map.class), any(CsarInfo.class), any(Service.class)))
+            .thenReturn(Either.left(new HashMap<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>>()));
+        doReturn(getParsedToscaYamlInfo()).when(csarBusinessLogic)
+            .getParsedToscaYamlInfo(anyString(), anyString(), any(), any(CsarInfo.class), any(), any(Service.class));
+        doReturn(getParsedToscaYamlInfo()).when(csarBusinessLogic).getParsedToscaYamlInfo(any(ServiceCsarInfo.class), any(Service.class));
+        when(serviceBusinessLogic.lockComponentByName(newService.getSystemName(), oldService, CREATE_RESOURCE)).thenReturn(Either.left(true));
+        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(createOldResource()));
+        when(serviceImportParseLogic.createServiceTransaction(oldService, csarInfo.getModifier(), false,
+            AuditingActionEnum.CREATE_RESOURCE)).thenReturn(newService);
+        when(serviceImportParseLogic.createInputsOnService(eq(oldService), anyMap())).thenReturn(newService);
+        Assertions.assertDoesNotThrow(() -> {
+            when(serviceImportParseLogic.createSubstitutionFilterOnService(eq(oldService), any())).thenReturn(newService);
+        });
+        when(serviceImportParseLogic.getNodeTypesFromTemplate(anyMap())).thenReturn(getNodeTypes());
+        when(serviceImportParseLogic.createNodeTypeResourceFromYaml(anyString(), any(Map.Entry.class), any(User.class), anyMap(), any(Service.class),
+            anyBoolean(), any(), anyList(), anyBoolean(), any(CsarInfo.class), anyBoolean())).thenReturn(
+            new ImmutablePair<>(resource, ActionStatus.OK));
+        when(serviceImportParseLogic.getComponentWithInstancesFilter()).thenReturn(new ComponentParametersView());
+        when(toscaOperationFacade.getToscaElement(anyString(), any(ComponentParametersView.class))).thenReturn(Either.left(newService));
+        when(serviceImportParseLogic.getComponentFilterAfterCreateRelations()).thenReturn(new ComponentParametersView());
+        when(toscaOperationFacade.getToscaElement(anyString(), any(ComponentParametersView.class))).thenReturn(Either.left(newService));
+        when(serviceImportParseLogic.findAvailableRequirement(anyString(), anyString(), any(UploadComponentInstanceInfo.class),
+            any(ComponentInstance.class), anyString())).thenReturn(Either.left(new RequirementDefinition()));
+        when(serviceImportParseLogic.findAvailableCapabilityByTypeOrName(any(RequirementDefinition.class), any(ComponentInstance.class),
+            any(UploadReqInfo.class))).thenReturn(new CapabilityDefinition());
+        when(componentsUtils.getResponseFormat(eq(ActionStatus.OK), anyString())).thenReturn(new ResponseFormat(200));
+        when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(newService));
+        doNothing().when(compositionBusinessLogic).setPositionsForComponentInstances(any(Service.class), anyString());
+        when(groupBusinessLogic.validateUpdateVfGroupNames(anyMap(), anyString())).thenReturn(Either.left(new HashMap<>()));
+        when(csarArtifactsAndGroupsBusinessLogic.deleteVFModules(any(Service.class), any(CsarInfo.class), anyBoolean(), anyBoolean()))
+            .thenReturn(Either.left(newService));
+        when(serviceImportParseLogic.getServiceWithGroups(anyString())).thenReturn(newService);
+        when(mockJanusGraphDao.commit()).thenReturn(JanusGraphOperationStatus.OK);
+        when(graphLockOperation.unlockComponentByName(anyString(), anyString(), any(NodeTypeEnum.class))).thenReturn(StorageOperationStatus.OK);
+        when(serviceImportParseLogic.createOutputsOnService(any(Service.class), any(), anyString())).thenReturn(newService);
+        when(toscaOperationFacade.updateInputsToComponent(anyList(), eq(newService.getUniqueId()))).thenReturn(Either.left(new ArrayList<>()));
+
+        when(applicationDataTypeCache.get(any(), contains("tosca.datatypes.test_"))).thenReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND));
+        DataTypeDefinition typeToBeUpdated = new DataTypeDefinition();
+        List<PropertyDefinition> properties = new ArrayList<>();
+        PropertyDefinition nameProperty = new PropertyDefinition();
+        nameProperty.setName("name");
+        nameProperty.setType("string");
+        properties.add(nameProperty);
+        PropertyDefinition versionProperty = new PropertyDefinition();
+        versionProperty.setName("version");
+        versionProperty.setType("string");
+        properties.add(versionProperty);
+        typeToBeUpdated.setProperties(properties);
+        when(applicationDataTypeCache.get(any(), eq("onap.datatypes.ToscaConceptIdentifier.datatype"))).thenReturn(Either.left(typeToBeUpdated));
+        when(applicationDataTypeCache.get(any(), matches("^((?!(tosca.datatypes.test_|onap.datatypes.ToscaConceptIdentifier)).)*$"))).thenReturn(
+            Either.left(new DataTypeDefinition()));
+
+        when(artifactTypeOperation.getArtifactTypeByUid(contains("tosca.testartifacts.Name"))).thenReturn(
+            Either.right(StorageOperationStatus.NOT_FOUND));
+        when(artifactTypeOperation.getArtifactTypeByUid(contains("tosca.artifacts"))).thenReturn(Either.left(null));
+
+        when(interfaceLifecycleTypeOperation.getInterface(contains("tosca.interfaces"))).thenReturn(Either.left(new InterfaceDefinition()));
+        when(interfaceLifecycleTypeOperation.getInterface(contains("tosca.interfaces.test"))).thenReturn(
+            Either.right(StorageOperationStatus.NOT_FOUND));
+
+        when(capabilityTypeOperation.getCapabilityType(anyString()))
+            .thenReturn(Either.left(new CapabilityTypeDefinition()));
+        when(capabilityTypeOperation.getCapabilityType(contains("tosca.testcapabilitytypes.Name")))
+            .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
+
+        when(toscaOperationFacade.getLatestByToscaResourceName(contains("org.openecomp.resource"), isNull()))
+            .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
+        when(toscaOperationFacade.getLatestByToscaResourceName(contains("tosca.nodes."), isNull()))
+            .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
+        when(toscaOperationFacade.getLatestByToscaResourceName(updatedNodeType, null)).thenReturn(Either.left(resource));
+        when(toscaOperationFacade.getLatestByToscaResourceName(contains("org.openecomp.service."), isNull()))
+            .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
+        when(artifactsBusinessLogic.handleDownloadRequestById(resourceUniqueId, artifactUniqueId, user.getUserId(), ComponentTypeEnum.RESOURCE, null,
+            null))
+            .thenReturn(resourceTemplate);
+        when(toscaOperationFacade.updatePropertyOfComponent(eq(oldService), any(PropertyDefinition.class))).thenReturn(Either.left(null));
+        when(toscaOperationFacade.updateComponentInstancePropsToComponent(anyMap(), anyString())).thenReturn(Either.left(null));
+        when(groupTypeOperation.getGroupTypeByUid(anyString())).thenReturn(Either.left(new GroupTypeDefinition()));
+
+        Service result = sIBL.createService(oldService, AuditingActionEnum.CREATE_RESOURCE, user, payload, payloadName);
+        assertNotNull(result);
+        assertNotNull(result.getComponentInstances());
+        assertEquals(1, result.getComponentInstances().size());
+        assertNotNull(result.getComponentInstances().get(0));
+        assertNotNull(result.getComponentInstances().get(0).getCapabilities());
+        assertEquals(1, result.getComponentInstances().get(0).getCapabilities().size());
+        assertNotNull(result.getComponentInstances().get(0).getRequirements());
+        assertEquals(1, result.getComponentInstances().get(0).getRequirements().size());
+        assertNotNull(result.getCategories());
+        assertEquals(1, result.getCategories().size());
+
+        ArgumentCaptor<String> yaml = ArgumentCaptor.forClass(String.class);
+        verify(dataTypeBusinessLogic).createDataTypeFromYaml(yaml.capture(), isNull(), anyBoolean());
+        Map<String, Object> yamlMap = new Yaml().load(yaml.getValue());
+        assertEquals(3, yamlMap.size());
+        assertNotNull(yamlMap.get("tosca.datatypes.test_a"));
+        assertNotNull(yamlMap.get("tosca.datatypes.test_b"));
+        assertNotNull(yamlMap.get("onap.datatypes.ToscaConceptIdentifier"));
+
+        ArgumentCaptor<String> artifactTypes = ArgumentCaptor.forClass(String.class);
+        verify(artifactTypeImportManager).createArtifactTypes(artifactTypes.capture(), isNull(), anyBoolean());
+        Map<String, Object> artifactTypesMap = new Yaml().load(artifactTypes.getValue());
+        assertEquals(1, artifactTypesMap.size());
+        assertNotNull(artifactTypesMap.get("tosca.testartifacts.Name"));
+
+        ArgumentCaptor<String> capabilityTypes = ArgumentCaptor.forClass(String.class);
+        verify(capabilityTypeImportManager).createCapabilityTypes(
+            capabilityTypes.capture(),
+            isNull(),
+            anyBoolean());
+        Map<String, Object> capabilityTypesMap = new Yaml().load(capabilityTypes.getValue());
+        assertEquals(1, capabilityTypesMap.size());
+        assertNotNull(capabilityTypesMap.get("tosca.testcapabilitytypes.Name"));
+
+        ArgumentCaptor<Map<String, Object>> nodeTypes = ArgumentCaptor.forClass(Map.class);
+        verify(resourceImportManager).importAllNormativeResource(nodeTypes.capture(), any(), any(), any(), any(),
+            anyBoolean(), anyBoolean());
+        Map<String, Object> nodeTypesMap = nodeTypes.getValue();
+        Map<String, Object> newUpdatedNodeType = (Map<String, Object>) nodeTypesMap.get(updatedNodeType);
+        assertEquals(8, ((Map<String, Object>) newUpdatedNodeType.get("properties")).size());
+        Assertions.assertNull(newUpdatedNodeType.get("attributes"));
+        assertEquals(3, ((List<Map<String, Object>>) newUpdatedNodeType.get("requirements")).size());
+        assertEquals(1, ((Map<String, Object>) newUpdatedNodeType.get("capabilities")).size());
+        assertEquals(2, ((Map<String, Object>) newUpdatedNodeType.get("interfaces")).size());
+
+        ArgumentCaptor<String> interfaceTypes = ArgumentCaptor.forClass(String.class);
+        verify(interfaceLifecycleTypeImportManager).createLifecycleTypes(interfaceTypes.capture(), any(), anyBoolean());
+        Map<String, Object> yamlInterfaceMap = new Yaml().load(interfaceTypes.getValue());
+        assertEquals(3, yamlInterfaceMap.size());
+        assertNotNull(yamlInterfaceMap.get("tosca.interfaces.test.node.lifecycle.Attach"));
+        assertNotNull(yamlInterfaceMap.get("tosca.interfaces.test.node.lifecycle.Detach"));
+        assertNotNull(yamlInterfaceMap.get("tosca.interfaces.test.node.lifecycle.Reconfigure"));
+
+    }
+
+    @Test
+    void testCreateService_Fail_NotFoundNodeTypesArtifacts() {
         Service oldService = createServiceObject(true);
         String payloadName = "valid_vf";
         Map<String, byte[]> payload = crateCsarFromPayload();
         Service newService = createServiceObject(true);
 
         when(serviceBusinessLogic.validateServiceBeforeCreate(any(Service.class), any(User.class), any(AuditingActionEnum.class)))
-                .thenReturn(Either.left(newService));
+            .thenReturn(Either.left(newService));
         when(toscaOperationFacade.validateCsarUuidUniqueness(anyString())).thenReturn(StorageOperationStatus.OK);
-        when(csarBusinessLogic.getCsarInfo(any(Service.class), any(),
-                any(User.class), any(Map.class), anyString())).thenReturn(getCsarInfo());
-        when(serviceImportParseLogic.findNodeTypesArtifactsToHandle(any(Map.class), any(CsarInfo.class),
-                any(Service.class))).thenReturn(Either.right(ActionStatus.GENERAL_ERROR));
-        when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), any(),
-                any(CsarInfo.class), anyString(), any(Service.class))).thenReturn(getParsedToscaYamlInfo());
-
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createService(oldService,
-                AuditingActionEnum.CREATE_RESOURCE, user, payload, payloadName));
+        when(csarBusinessLogic.getCsarInfo(any(Service.class), any(), any(User.class), any(Map.class), anyString(), any())).thenReturn(getCsarInfo());
+        when(serviceImportParseLogic.findNodeTypesArtifactsToHandle(any(Map.class), any(CsarInfo.class), any(Service.class)))
+            .thenReturn(Either.right(ActionStatus.GENERAL_ERROR));
+        when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), any(), any(CsarInfo.class), anyString(),
+            any(Service.class))).thenReturn(getParsedToscaYamlInfo());
 
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.createService(oldService, AuditingActionEnum.CREATE_RESOURCE, user, payload, payloadName));
     }
 
     @Test
-    public void testCreateServiceFromCsar() {
+    void testCreateServiceFromCsar() {
         Service oldService = createServiceObject(true);
         String csarUUID = "valid_vf";
         Map<String, byte[]> payload = crateCsarFromPayload();
-        CsarInfo csarInfo = getCsarInfo();
+        ServiceCsarInfo csarInfo = getCsarInfo();
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> map =
-                new HashedMap();
+            new HashedMap();
 
         when(csarBusinessLogic.getCsarInfo(any(Service.class), any(), any(User.class),
-                any(Map.class), anyString())).thenReturn(csarInfo);
+            any(Map.class), anyString(), any())).thenReturn(csarInfo);
         when(serviceImportParseLogic.findNodeTypesArtifactsToHandle(any(Map.class), any(CsarInfo.class),
-                any(Service.class))).thenReturn(Either.left(map));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createServiceFromCsar(oldService,
-                user, payload, csarUUID));
+            any(Service.class))).thenReturn(Either.left(map));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createServiceFromCsar(oldService,
+            user, payload, csarUUID, null));
     }
 
     @Test
-    public void testCreateServiceFromYaml() {
+    void testCreateServiceFromYaml() {
         Service oldService = createServiceObject(true);
         Resource resource = createOldResource();
         String topologyTemplateYaml = getMainTemplateContent("service_import_template.yml");
         String yamlName = "group.yml";
-        CsarInfo csarInfo = getCsarInfo();
+        ServiceCsarInfo csarInfo = getCsarInfo();
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToCreate = new HashMap<>();
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
 
-
         Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
         Map<String, Object> map = new HashMap<>();
         map.put("tosca_definitions_version", "123");
         nodeTypesInfo.get(nodeName).setMappedToscaTemplate(map);
         ParsedToscaYamlInfo parsedToscaYamlInfo = getParsedToscaYamlInfo();
-        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString()))
-                .thenReturn(Either.left(resource));
+        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(resource));
         when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), any(Map.class),
-                eq(csarInfo), anyString(), any(Component.class))).thenReturn(parsedToscaYamlInfo);
+            eq(csarInfo), anyString(), any(Component.class))).thenReturn(parsedToscaYamlInfo);
         when(serviceBusinessLogic.lockComponentByName(anyString(), any(Service.class), anyString()))
-                .thenReturn(Either.left(true));
+            .thenReturn(Either.left(true));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createServiceFromYaml(oldService,
-                topologyTemplateYaml, yamlName, nodeTypesInfo, csarInfo,
-                nodeTypesArtifactsToCreate, false, true, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createServiceFromYaml(oldService,
+            topologyTemplateYaml, yamlName, nodeTypesInfo, csarInfo,
+            nodeTypesArtifactsToCreate, false, true, nodeName, user.getUserId(), null));
     }
 
     @Test
-    public void testCreateServiceAndRIsFromYaml() {
+    void testCreateServiceAndRIsFromYaml() {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Service oldService = createServiceObject(true);
         Resource resource = createOldResource();
@@ -245,14 +423,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ParsedToscaYamlInfo parsedToscaYamlInfo = getParsedToscaYamlInfo();
         csfyp.setNodeTypesInfo(nodeTypesInfo);
         csfyp.setParsedToscaYamlInfo(parsedToscaYamlInfo);
-        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString()))
-                .thenReturn(Either.left(resource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createServiceAndRIsFromYaml(oldService,
-                false, nodeTypesArtifactsToCreate, false, true, csfyp));
+        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(resource));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createServiceAndRIsFromYaml(oldService,
+            false, nodeTypesArtifactsToCreate, false, true, csfyp, user.getUserId(), null));
     }
 
     @Test
-    public void testCreateServiceAndRIsFromYamlShoudLook() {
+    void testCreateServiceAndRIsFromYamlShoudLook() {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Service oldService = createServiceObject(true);
         Resource resource = createOldResource();
@@ -265,14 +442,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ParsedToscaYamlInfo parsedToscaYamlInfo = getParsedToscaYamlInfo();
         csfyp.setNodeTypesInfo(nodeTypesInfo);
         csfyp.setParsedToscaYamlInfo(parsedToscaYamlInfo);
-        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString()))
-                .thenReturn(Either.left(resource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createServiceAndRIsFromYaml(oldService,
-                false, nodeTypesArtifactsToCreate, false, true, csfyp));
+        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(resource));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createServiceAndRIsFromYaml(oldService,
+            false, nodeTypesArtifactsToCreate, false, true, csfyp, user.getUserId(), null));
     }
 
     @Test
-    public void testCreateOrUpdateArtifacts() {
+    void testCreateOrUpdateArtifacts() {
         ArtifactsBusinessLogic.ArtifactOperationEnum operation = ArtifactsBusinessLogic.ArtifactOperationEnum.UPDATE;
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         String yamlFileName = "group.yml";
@@ -282,28 +458,26 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>> enumListEnumMap =
-                new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         List<ArtifactDefinition> artifactDefinitions = new ArrayList<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
         artifactDefinition.setArtifactName("artifactName");
         artifactDefinitions.add(artifactDefinition);
         enumListEnumMap.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE,
-                artifactDefinitions);
+            artifactDefinitions);
         nodeTypesArtifactsToHandle.put(nodeName, enumListEnumMap);
         NodeTypeInfoToUpdateArtifacts nodeTypeInfoToUpdateArtifacts = new NodeTypeInfoToUpdateArtifacts(nodeName, nodeTypesArtifactsToHandle);
         nodeTypeInfoToUpdateArtifacts.setNodeName(nodeName);
         nodeTypeInfoToUpdateArtifacts.setNodeTypesArtifactsToHandle(nodeTypesArtifactsToHandle);
 
         Assertions.assertNotNull(
-                sIB1.createOrUpdateArtifacts(operation, createdArtifacts, yamlFileName, csarInfo,
-                        preparedResource, nodeTypeInfoToUpdateArtifacts, true, true)
+            sIBL.createOrUpdateArtifacts(operation, createdArtifacts, yamlFileName, csarInfo,
+                preparedResource, nodeTypeInfoToUpdateArtifacts, true, true)
         );
-
-
     }
 
     @Test
-    public void testHandleVfCsarArtifacts() {
+    void testHandleVfCsarArtifacts() {
         Resource resource = createParseResourceObject(true);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -321,15 +495,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE);
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(resource));
         when(csarArtifactsAndGroupsBusinessLogic
-                .createResourceArtifactsFromCsar(any(CsarInfo.class), any(Resource.class), anyString(), anyString(),
-                        anyList())).thenReturn(Either.left(resource));
+            .createResourceArtifactsFromCsar(any(CsarInfo.class), any(Resource.class), anyString(), anyString(),
+                anyList())).thenReturn(Either.left(resource));
         Assertions.assertNotNull(
-                sIB1.handleVfCsarArtifacts(resource,
-                        csarInfo, createdArtifacts, artifactOperation, true, true));
+            sIBL.handleVfCsarArtifacts(resource,
+                csarInfo, createdArtifacts, artifactOperation, true, true));
     }
 
     @Test
-    public void testHandleVfCsarArtifactsGetToscaElement() {
+    void testHandleVfCsarArtifactsGetToscaElement() {
         Resource resource = createParseResourceObject(true);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -347,15 +521,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE);
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(resource));
         when(csarArtifactsAndGroupsBusinessLogic
-                .createResourceArtifactsFromCsar(any(CsarInfo.class), any(Resource.class), anyString(), anyString(),
-                        anyList())).thenReturn(Either.left(resource));
+            .createResourceArtifactsFromCsar(any(CsarInfo.class), any(Resource.class), anyString(), anyString(),
+                anyList())).thenReturn(Either.left(resource));
         Assertions.assertNotNull(
-                sIB1.handleVfCsarArtifacts(resource,
-                        csarInfo, createdArtifacts, artifactOperation, true, true));
+            sIBL.handleVfCsarArtifacts(resource,
+                csarInfo, createdArtifacts, artifactOperation, true, true));
     }
 
     @Test
-    public void testCreateOrUpdateSingleNonMetaArtifactToComstants() {
+    void testCreateOrUpdateSingleNonMetaArtifactToComstants() {
         Resource resource = createParseResourceObject(false);
         CsarInfo csarInfo = getCsarInfo();
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.UPDATE);
@@ -366,25 +540,24 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         resource.setDeploymentArtifacts(deploymentArtifacts);
         Assertions.assertNotNull(resource);
         Assertions.assertNotNull(csarInfo);
-        sIB1.createOrUpdateSingleNonMetaArtifactToComstants(resource, csarInfo, artifactOperation, true, true);
+        sIBL.createOrUpdateSingleNonMetaArtifactToComstants(resource, csarInfo, artifactOperation, true, true);
 
     }
 
-
     @Test
-    public void testCreateOrUpdateNonMetaArtifacts() {
+    void testCreateOrUpdateNonMetaArtifacts() {
         CsarInfo csarInfo = getCsarInfo();
         Resource resource = createParseResourceObject(false);
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.UPDATE);
 
-        Either<Resource, ResponseFormat> result = sIB1.createOrUpdateNonMetaArtifacts(csarInfo, resource,
-                createdArtifacts, true, true, artifactOperation);
+        Either<Resource, ResponseFormat> result = sIBL.createOrUpdateNonMetaArtifacts(csarInfo, resource,
+            createdArtifacts, true, true, artifactOperation);
         assertEquals(result.left().value(), resource);
     }
 
     @Test
-    public void testFindVfCsarArtifactsToHandle() {
+    void testFindVfCsarArtifactsToHandle() {
         Resource resource = createParseResourceObject(false);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -403,25 +576,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
 
         Either<EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>>,
-                ResponseFormat> result = sIB1.findVfCsarArtifactsToHandle(resource, artifactPathAndNameList, user);
+            ResponseFormat> result = sIBL.findVfCsarArtifactsToHandle(resource, artifactPathAndNameList, user);
         assertNotNull(result.left().value());
     }
 
-
     @Test
-    public void testIsNonMetaArtifact() {
-        ArtifactDefinition artifactDefinition = new ArtifactDefinition();
-        artifactDefinition.setMandatory(false);
-        artifactDefinition.setArtifactName("creatorFullName");
-        artifactDefinition.setArtifactType("TOSCA_CSAR");
-
-        boolean nonMetaArtifact = sIB1.isNonMetaArtifact(artifactDefinition);
-        assertTrue(nonMetaArtifact);
-
-    }
-
-    @Test
-    public void testOrganizeVfCsarArtifactsByArtifactOperation() {
+    void testOrganizeVfCsarArtifactsByArtifactOperation() {
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
         artifactPathAndNameList.add(getNonMetaArtifactInfo());
         List<ArtifactDefinition> existingArtifactsToHandle = new ArrayList<>();
@@ -433,12 +593,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Resource resource = createParseResourceObject(false);
 
         Either<EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>>, ResponseFormat>
-                enumMapResponseFormatEither = sIB1.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList, existingArtifactsToHandle, resource, user);
+            enumMapResponseFormatEither = sIBL.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList,
+            existingArtifactsToHandle,
+            resource, user);
         assertNotNull(enumMapResponseFormatEither.left().value());
     }
 
     @Test
-    public void testOrganizeVfCsarArtifactsByArtifactOperationElse() {
+    void testOrganizeVfCsarArtifactsByArtifactOperationElse() {
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
         artifactPathAndNameList.add(getNonMetaArtifactInfo());
         List<ArtifactDefinition> existingArtifactsToHandle = new ArrayList<>();
@@ -449,12 +611,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         existingArtifactsToHandle.add(artifactDefinition);
         Resource resource = createParseResourceObject(false);
         Assertions.assertNotNull(
-                sIB1.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList, existingArtifactsToHandle, resource, user));
-
+            sIBL.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList, existingArtifactsToHandle, resource,
+                user));
     }
 
     @Test
-    public void testProcessCsarArtifacts() {
+    void testProcessCsarArtifacts() {
         CsarInfo csarInfo = getCsarInfo();
         Resource resource = createParseResourceObject(false);
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
@@ -462,16 +624,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
         artifactPathAndNameList.add(getNonMetaArtifactInfo());
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>> vfCsarArtifactsToHandle = new
-                EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         vfCsarArtifactsToHandle.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE, artifactPathAndNameList);
         Assertions.assertNotNull(
-                sIB1.processCsarArtifacts(csarInfo,
-                        resource, createdArtifacts, true, true, resStatus, vfCsarArtifactsToHandle));
-
+            sIBL.processCsarArtifacts(csarInfo,
+                resource, createdArtifacts, true, true, resStatus, vfCsarArtifactsToHandle));
     }
 
     @Test
-    public void testCreateOrUpdateSingleNonMetaArtifact() {
+    void testCreateOrUpdateSingleNonMetaArtifact() {
         Resource resource = createParseResourceObject(false);
         CsarInfo csarInfo = getCsarInfo();
         Map<String, byte[]> csar = csarInfo.getCsar();
@@ -494,34 +655,18 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         artifactDefinition.setArtifactName("artifactName");
         Either<ArtifactDefinition, Operation> artifactDefinitionOperationEither = Either.left(artifactDefinition);
         when(csarArtifactsAndGroupsBusinessLogic.createOrUpdateCsarArtifactFromJson(any(Resource.class), any(User.class),
-                any(Map.class), any(ArtifactOperationInfo.class))).thenReturn(Either.left(artifactDefinitionOperationEither));
-        Assertions.assertNotNull(
-                sIB1.createOrUpdateSingleNonMetaArtifact(resource, csarInfo, artifactPath,
-                        artifactFileName, artifactType, artifactGroupType, artifactLabel,
-                        artifactDisplayName, artifactDescription, artifactId, artifactOperation,
-                        createdArtifacts, true, true, true));
-    }
-
-    @Test
-    public void testHandleNodeTypeArtifacts() {
-        Resource nodeTypeResource = createParseResourceObject(true);
-        nodeTypeResource.setLifecycleState(LifecycleStateEnum.CERTIFIED);
-        Map<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>> nodeTypeArtifactsToHandle = new HashMap<>();
-        List<ArtifactDefinition> artifactDefinitions = new ArrayList<>();
-        ArtifactDefinition artifactDefinition = new ArtifactDefinition();
-        artifactDefinition.setArtifactName("artifactName");
-        artifactDefinitions.add(artifactDefinition);
-        nodeTypeArtifactsToHandle.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE,
-                artifactDefinitions);
-        List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
+            any(Map.class), any(ArtifactOperationInfo.class))).thenReturn(Either.left(artifactDefinitionOperationEither));
+        when(artifactsBusinessLogic.handleDelete(anyString(), anyString(), any(User.class), any(Component.class), anyBoolean(), anyBoolean()))
+            .thenReturn(Either.left(artifactDefinition));
         Assertions.assertNotNull(
-                sIB1.handleNodeTypeArtifacts(nodeTypeResource, nodeTypeArtifactsToHandle,
-                        createdArtifacts, user, true, true));
+            sIBL.createOrUpdateSingleNonMetaArtifact(resource, csarInfo, artifactPath,
+                artifactFileName, artifactType, artifactGroupType, artifactLabel,
+                artifactDisplayName, artifactDescription, artifactId, artifactOperation,
+                createdArtifacts, true, true, true));
     }
 
-
     @Test
-    public void testCreateOrUpdateServiceArtifacts() throws IOException {
+    void testCreateOrUpdateServiceArtifacts() throws IOException {
         ArtifactsBusinessLogic.ArtifactOperationEnum operation = ArtifactsBusinessLogic.ArtifactOperationEnum.UPDATE;
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         String yamlFileName = "group.yml";
@@ -537,20 +682,17 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         artifactDefinition.setArtifactName("artifactDefinition");
         deploymentArtifacts.put("deploymentArtifacts", artifactDefinition);
         preparedService.setDeploymentArtifacts(deploymentArtifacts);
-        String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
-        Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
-        NodeTypeInfoToUpdateArtifacts nodeTypeInfoToUpdateArtifacts = new NodeTypeInfoToUpdateArtifacts(nodeName, nodeTypesArtifactsToHandle);
 
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(createServiceObject(true)));
         when(csarArtifactsAndGroupsBusinessLogic.updateResourceArtifactsFromCsar(any(CsarInfo.class), any(Service.class),
-                anyString(), anyString(), anyList(), anyBoolean(), anyBoolean())).thenReturn(Either.left(preparedService));
+            anyString(), anyString(), anyList(), anyBoolean(), anyBoolean())).thenReturn(Either.left(preparedService));
         Assertions.assertNotNull(
-                sIB1.createOrUpdateArtifacts(operation, createdArtifacts, yamlFileName, csarInfo,
-                        preparedService, nodeTypeInfoToUpdateArtifacts, true, true));
+            sIBL.createOrUpdateArtifacts(operation, createdArtifacts, yamlFileName, csarInfo,
+                preparedService, true, true));
     }
 
     @Test
-    public void testHandleVfCsarServiceArtifacts() {
+    void testHandleVfCsarServiceArtifacts() {
         Service service = createServiceObject(true);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -562,14 +704,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE);
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(service));
-        when(csarArtifactsAndGroupsBusinessLogic.deleteVFModules(any(Service.class), any(CsarInfo.class), anyBoolean(), anyBoolean())).thenReturn(Either.left(service));
+        when(csarArtifactsAndGroupsBusinessLogic.deleteVFModules(any(Service.class), any(CsarInfo.class), anyBoolean(), anyBoolean())).thenReturn(
+            Either.left(service));
         Assertions.assertNotNull(
-                sIB1.handleVfCsarArtifacts(service, csarInfo, createdArtifacts, artifactOperation, true, true));
-
+            sIBL.handleVfCsarArtifacts(service, csarInfo, createdArtifacts, artifactOperation, true, true));
     }
 
     @Test
-    public void testHandleVfCsarServiceArtifactsGetToscaElement() throws IOException {
+    void testHandleVfCsarServiceArtifactsGetToscaElement() throws IOException {
         Service service = createServiceObject(true);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -587,26 +729,26 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE);
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(service));
         when(csarArtifactsAndGroupsBusinessLogic.createResourceArtifactsFromCsar(any(CsarInfo.class), any(Service.class),
-                anyString(), anyString(), anyList())).thenReturn(Either.left(service));
+            anyString(), anyString(), anyList())).thenReturn(Either.left(service));
         Assertions.assertNotNull(
-                sIB1.handleVfCsarArtifacts(service,
-                        csarInfo, createdArtifacts, artifactOperation, true, true));
+            sIBL.handleVfCsarArtifacts(service,
+                csarInfo, createdArtifacts, artifactOperation, true, true));
     }
 
     @Test
-    public void testCreateOrUpdateNonMetaServiceArtifacts() {
+    void testCreateOrUpdateNonMetaServiceArtifacts() {
         CsarInfo csarInfo = getCsarInfo();
         Service service = createServiceObject(true);
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE);
 
-        Either<Service, ResponseFormat> result = sIB1.createOrUpdateNonMetaArtifacts(csarInfo,
-                service, createdArtifacts, true, true, artifactOperation);
+        Either<Service, ResponseFormat> result = sIBL.createOrUpdateNonMetaArtifacts(csarInfo,
+            service, createdArtifacts, true, true, artifactOperation);
         assertEquals(result.left().value(), service);
     }
 
     @Test
-    public void testFindServiceCsarArtifactsToHandle() {
+    void testFindServiceCsarArtifactsToHandle() {
         Service service = createServiceObject(true);
         Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
@@ -625,12 +767,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
 
         Either<EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>>,
-                ResponseFormat> result = sIB1.findVfCsarArtifactsToHandle(service, artifactPathAndNameList, user);
+            ResponseFormat> result = sIBL.findVfCsarArtifactsToHandle(service, artifactPathAndNameList, user);
         assertNotNull(result.left().value());
     }
 
     @Test
-    public void testOrganizeVfCsarArtifactsByServiceArtifactOperation() {
+    void testOrganizeVfCsarArtifactsByServiceArtifactOperation() {
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
         artifactPathAndNameList.add(getNonMetaArtifactInfo());
         List<ArtifactDefinition> existingArtifactsToHandle = new ArrayList<>();
@@ -642,13 +784,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Service service = createServiceObject(true);
 
         Either<EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>>, ResponseFormat>
-                enumMapResponseFormatEither = sIB1.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList,
-                existingArtifactsToHandle, service, user);
+            enumMapResponseFormatEither = sIBL.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList,
+            existingArtifactsToHandle, service, user);
         assertNotNull(enumMapResponseFormatEither.left().value());
     }
 
     @Test
-    public void testOrganizeVfCsarArtifactsByServiceArtifactOperationElse() {
+    void testOrganizeVfCsarArtifactsByServiceArtifactOperationElse() {
         List<CsarUtils.NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>();
         artifactPathAndNameList.add(getNonMetaArtifactInfo());
         List<ArtifactDefinition> existingArtifactsToHandle = new ArrayList<>();
@@ -659,37 +801,36 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         existingArtifactsToHandle.add(artifactDefinition);
         Service service = createServiceObject(true);
         Assertions.assertNotNull(
-                sIB1.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList, existingArtifactsToHandle, service, user));
+            sIBL.organizeVfCsarArtifactsByArtifactOperation(artifactPathAndNameList, existingArtifactsToHandle, service, user));
 
     }
 
     @Test
-    public void testProcessServiceCsarArtifacts() {
+    void testProcessServiceCsarArtifacts() {
         CsarInfo csarInfo = getCsarInfo();
         Service service = createServiceObject(true);
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         Either<Service, ResponseFormat> resStatus = Either.left(service);
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<CsarUtils.NonMetaArtifactInfo>> vfCsarArtifactsToHandle = new
-                EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         List<CsarUtils.NonMetaArtifactInfo> objects = new ArrayList<>();
         objects.add(getNonMetaArtifactInfo());
         vfCsarArtifactsToHandle.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE, objects);
         Assertions.assertNotNull(
-                sIB1.processCsarArtifacts(csarInfo,
-                        service, createdArtifacts, true, true, resStatus, vfCsarArtifactsToHandle));
-
+            sIBL.processCsarArtifacts(csarInfo, service, createdArtifacts, true, true, resStatus, vfCsarArtifactsToHandle));
     }
 
     @Test
-    public void testGetValidArtifactNames() {
+    void testGetValidArtifactNames() {
         CsarInfo csarInfo = getCsarInfo();
         Map<String, Set<List<String>>> collectedWarningMessages = new HashMap<>();
-        Either<List<CsarUtils.NonMetaArtifactInfo>, String> result = sIB1.getValidArtifactNames(csarInfo, collectedWarningMessages);
+        Either<List<CsarUtils.NonMetaArtifactInfo>, String> result = sIBL.getValidArtifactNames(csarInfo,
+            collectedWarningMessages);
         assertNotNull(result.left().value());
     }
 
     @Test
-    public void testCreateOrUpdateSingleNonMetaServiceArtifact() {
+    void testCreateOrUpdateSingleNonMetaServiceArtifact() {
         Service service = createServiceObject(true);
         CsarInfo csarInfo = getCsarInfo();
         Map<String, byte[]> csar = csarInfo.getCsar();
@@ -713,16 +854,18 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         artifactDefinition.setArtifactName("artifactName");
         Either<ArtifactDefinition, Operation> artifactDefinitionOperationEither = Either.left(artifactDefinition);
         when(csarArtifactsAndGroupsBusinessLogic.createOrUpdateCsarArtifactFromJson(any(Service.class), any(User.class),
-                anyMap(), any(ArtifactOperationInfo.class))).thenReturn(Either.left(artifactDefinitionOperationEither));
+            anyMap(), any(ArtifactOperationInfo.class))).thenReturn(Either.left(artifactDefinitionOperationEither));
+        when(artifactsBusinessLogic.handleDelete(anyString(), anyString(), any(User.class), any(Component.class), anyBoolean(), anyBoolean()))
+            .thenReturn(Either.left(artifactDefinition));
         Assertions.assertNotNull(
-                sIB1.createOrUpdateSingleNonMetaArtifact(service, csarInfo, artifactPath, artifactFileName,
-                        artifactType, artifactGroupType, artifactLabel, artifactDisplayName,
-                        artifactDescription, artifactId, artifactOperation, createdArtifacts,
-                        true, true, true));
+            sIBL.createOrUpdateSingleNonMetaArtifact(service, csarInfo, artifactPath, artifactFileName,
+                artifactType, artifactGroupType, artifactLabel, artifactDisplayName,
+                artifactDescription, artifactId, artifactOperation, createdArtifacts,
+                true, true, true));
     }
 
     @Test
-    public void testCreateOrUpdateSingleNonMetaServiceArtifactNull() {
+    void testCreateOrUpdateSingleNonMetaServiceArtifactNull() {
         Service service = createServiceObject(true);
         CsarInfo csarInfo = getCsarInfo();
         String artifactPath = "valid_vf.csar", artifactFileName = "", artifactType = "";
@@ -730,55 +873,50 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String artifactLabel = "", artifactDisplayName = "", artifactDescription = "", artifactId = "artifactId";
         ArtifactOperationInfo artifactOperation = new ArtifactOperationInfo(true, true, ArtifactsBusinessLogic.ArtifactOperationEnum.UPDATE);
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
+        when(artifactsBusinessLogic.handleDelete(anyString(), anyString(), any(User.class), any(Component.class), anyBoolean(), anyBoolean()))
+            .thenReturn(Either.left(artifactDefinition));
         Assertions.assertNotNull(
-                sIB1.createOrUpdateSingleNonMetaArtifact(service, csarInfo, artifactPath, artifactFileName,
-                        artifactType, artifactGroupType, artifactLabel, artifactDisplayName,
-                        artifactDescription, artifactId, artifactOperation, createdArtifacts,
-                        true, true, true));
+            sIBL.createOrUpdateSingleNonMetaArtifact(service, csarInfo, artifactPath, artifactFileName,
+                artifactType, artifactGroupType, artifactLabel, artifactDisplayName,
+                artifactDescription, artifactId, artifactOperation, createdArtifacts,
+                true, true, true));
     }
 
     @Test
-    public void testCreateGroupsOnResource() {
+    void testCreateGroupsOnResource() {
         Service service = createServiceObject(true);
         Map<String, GroupDefinition> groups = new HashMap<>();
-        Assertions.assertNotNull(
-                sIB1.createGroupsOnResource(service, groups));
+        Assertions.assertNotNull(sIBL.createGroupsOnResource(service, groups));
     }
 
     @Test
-    public void testCreateGroupsOnResourceNull() {
+    void testCreateGroupsOnResourceNull() {
         Service service = createServiceObject(true);
         Map<String, GroupDefinition> groups = new HashMap<>();
         Assertions.assertNotNull(
-                sIB1.createGroupsOnResource(service, groups));
-
-
+            sIBL.createGroupsOnResource(service, groups));
     }
 
     @Test
-    public void testUpdateGroupsMembersUsingResource() {
+    void testUpdateGroupsMembersUsingResource() {
         Service service = createServiceObject(true);
         Map<String, GroupDefinition> groups = getGroups();
-        when(serviceImportParseLogic.validateCyclicGroupsDependencies(any()))
-                .thenReturn(Either.left(true));
-        Assertions.assertNotNull(
-                sIB1.updateGroupsMembersUsingResource(groups, service));
 
+        Assertions.assertNotNull(
+            sIBL.updateGroupsMembersUsingResource(groups, service));
     }
 
     @Test
-    public void testUpdateGroupsMembersUsingResource_left() {
+    void testUpdateGroupsMembersUsingResource_left() {
         Service service = createServiceObject(true);
         Map<String, GroupDefinition> groups = getGroups();
-        when(serviceImportParseLogic.validateCyclicGroupsDependencies(any()))
-                .thenReturn(Either.left(true));
-        Assertions.assertNotNull(
-                sIB1.updateGroupsMembersUsingResource(groups, service));
 
+        Assertions.assertNotNull(
+            sIBL.updateGroupsMembersUsingResource(groups, service));
     }
 
     @Test
-    public void testCreateRIAndRelationsFromResourceYaml() throws IOException {
+    void testCreateRIAndRelationsFromResourceYaml() throws IOException {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
@@ -794,44 +932,42 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         CsarInfo csarInfo = getCsarInfo();
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToCreate = new HashMap<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createRIAndRelationsFromYaml(yamlName, resource, uploadComponentInstanceInfoMap,
-                        topologyTemplateYaml, nodeTypesNewCreatedArtifacts, nodeTypesInfo,
-                        csarInfo, nodeTypesArtifactsToCreate, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createRIAndRelationsFromYaml(yamlName, resource, uploadComponentInstanceInfoMap,
+                topologyTemplateYaml, nodeTypesNewCreatedArtifacts, nodeTypesInfo,
+                csarInfo, nodeTypesArtifactsToCreate, nodeName));
     }
 
-
     @Test
-    public void testCreateResourceInstancesRelations() {
+    void testCreateResourceInstancesRelations() {
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
         resource.setComponentInstances(creatComponentInstances());
         resource.setResourceType(ResourceTypeEnum.VF);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        uploadResInstancesMap.put("uploadResInstancesMap", getuploadComponentInstanceInfo());
+        uploadResInstancesMap.put("uploadResInstancesMap", getUploadComponentInstanceInfo());
         when(serviceImportParseLogic.getResourceAfterCreateRelations(any(Resource.class))).thenReturn(resource);
         when(toscaOperationFacade.getToscaFullElement(anyString())).thenReturn(Either.left(resource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourceInstancesRelations(user, yamlName, resource, uploadResInstancesMap));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createResourceInstancesRelations(user, yamlName, resource, uploadResInstancesMap));
     }
 
     @Test
-    public void testCreateResourceInstancesRelations_Empty() {
+    void testCreateResourceInstancesRelations_Empty() {
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
         resource.setComponentInstances(creatComponentInstances());
         resource.setResourceType(ResourceTypeEnum.VF);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        uploadResInstancesMap.put("uploadResInstancesMap", getuploadComponentInstanceInfo());
+        uploadResInstancesMap.put("uploadResInstancesMap", getUploadComponentInstanceInfo());
         when(serviceImportParseLogic.getResourceAfterCreateRelations(any(Resource.class))).thenReturn(resource);
         when(toscaOperationFacade.getToscaFullElement(anyString())).thenReturn(Either.left(resource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourceInstancesRelations(user, yamlName, resource, uploadResInstancesMap));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createResourceInstancesRelations(user, yamlName, resource, uploadResInstancesMap));
     }
 
-
     @Test
-    public void testProcessComponentInstance1() {
+    void testProcessComponentInstance1() {
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -848,6 +984,7 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Map<String, ArtifactDefinition>> instDeploymentArtifacts = new HashMap<>();
         Map<String, Map<String, ArtifactDefinition>> instArtifacts = new HashMap<>();
         Map<String, List<AttributeDefinition>> instAttributes = new HashMap<>();
+        Map<String, UploadNodeFilterInfo> instNodeFilter = new HashMap<>();
         Map<String, Resource> originCompMap = new HashMap<>();
         originCompMap.put("componentUid", originResource);
         Map<String, List<ComponentInstanceInput>> instInputs = new HashMap<>();
@@ -855,13 +992,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         uploadComponentInstanceInfo.setName("zxjTestImportServiceAb");
         Assertions.assertNotNull(resource);
         Assertions.assertNotNull(yamlName);
-        sIB1.processComponentInstance(yamlName, resource, componentInstancesList, allDataTypes.left().value(), instProperties,
-                instCapabilties, instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes,
-                originCompMap, instInputs, uploadComponentInstanceInfo);
+        sIBL.processComponentInstance(yamlName, resource, componentInstancesList, allDataTypes.left().value(), instProperties,
+            instCapabilties, instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes,
+            originCompMap, instInputs, instNodeFilter, null, uploadComponentInstanceInfo);
     }
 
     @Test
-    public void testProcessComponentInstance_null() {
+    void testProcessComponentInstance_null() {
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -874,19 +1011,20 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Map<String, ArtifactDefinition>> instArtifacts = new HashMap<>();
         Map<String, List<AttributeDefinition>> instAttributes = new HashMap<>();
         Map<String, Resource> originCompMap = new HashMap<>();
+        Map<String, UploadNodeFilterInfo> instNodeFilter = new HashMap<>();
         originCompMap.put("componentUid", originResource);
         Map<String, List<ComponentInstanceInput>> instInputs = new HashMap<>();
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         uploadComponentInstanceInfo.setName("zxjTestImportServiceAb0");
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.processComponentInstance(yamlName,
-                resource, componentInstancesList, null, instProperties, instCapabilties,
-                instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes, originCompMap,
-                instInputs, uploadComponentInstanceInfo));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.processComponentInstance(yamlName,
+            resource, componentInstancesList, null, instProperties, instCapabilties,
+            instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes, originCompMap,
+            instInputs, instNodeFilter, null, uploadComponentInstanceInfo));
     }
 
     @Test
-    public void testAddInputsValuesToRi() {
+    void testAddInputsValuesToRi() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         Map<String, List<UploadPropInfo>> properties = new HashMap<>();
         List<UploadPropInfo> uploadPropInfoList = getPropertyList();
@@ -908,13 +1046,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         dataTypeDefinition.setName("dataTypeDefinitionName");
         allDataTypes.put("dataTypeDefinitionMap", dataTypeDefinition);
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .addInputsValuesToRi(uploadComponentInstanceInfo, resource, originResource,
-                        currentCompInstance, instInputs, allDataTypes));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .addInputsValuesToRi(uploadComponentInstanceInfo, resource, originResource,
+                currentCompInstance, instInputs, allDataTypes));
     }
 
     @Test
-    public void testProcessProperty() {
+    void testProcessProperty() {
         Resource resource = createParseResourceObject(true);
         List<InputDefinition> inputs = new ArrayList<>();
         InputDefinition inputDefinition = new InputDefinition();
@@ -931,35 +1069,35 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         List<UploadPropInfo> propertyList = getPropertyList();
         Assertions.assertNotNull(resource);
         Assertions.assertNotNull(currPropertiesMap);
-        sIB1.processProperty(resource, currentCompInstance, allDataTypes, currPropertiesMap, instPropList, propertyList);
+        sIBL.processProperty(resource, allDataTypes, currPropertiesMap, instPropList, propertyList);
     }
 
     @Test
-    public void testHandleSubstitutionMappings() {
+    void testHandleSubstitutionMappings() {
         Resource resource = createParseResourceObject(true);
         resource.setResourceType(ResourceTypeEnum.VF);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
         when(toscaOperationFacade.getToscaFullElement(anyString()))
-                .thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
+            .thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .handleSubstitutionMappings(resource, uploadResInstancesMap));
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.handleSubstitutionMappings(resource, uploadResInstancesMap));
     }
 
     @Test
-    public void testHandleSubstitutionMappings_left() {
+    void testHandleSubstitutionMappings_left() {
         Resource resource = createParseResourceObject(true);
         resource.setResourceType(ResourceTypeEnum.VF);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
         when(toscaOperationFacade.getToscaFullElement(anyString()))
-                .thenReturn(Either.left(resource));
+            .thenReturn(Either.left(resource));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .handleSubstitutionMappings(resource, uploadResInstancesMap));
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.handleSubstitutionMappings(resource, uploadResInstancesMap));
     }
 
     @Test
-    public void testCreateResourceInstances() {
+    void testCreateResourceInstances() {
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -971,12 +1109,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Resource> nodeNamespaceMap = new HashMap<>();
         nodeNamespaceMap.put("resources", originResource);
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourceInstances(yamlName, resource, uploadResInstancesMap, nodeNamespaceMap));
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.createResourceInstances(yamlName, resource, uploadResInstancesMap, nodeNamespaceMap));
     }
 
     @Test
-    public void testHandleNodeTypes() throws IOException {
+    void testHandleNodeTypes() throws IOException {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(true);
@@ -992,12 +1130,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         CsarInfo csarInfo = getCsarInfo();
         Assertions.assertNotNull(resource);
 
-        sIB1.handleNodeTypes(yamlName, resource, topologyTemplateYaml, needLock, nodeTypesArtifactsToHandle,
-                nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo, nodeName);
+        sIBL.handleNodeTypes(yamlName, resource, topologyTemplateYaml, needLock, nodeTypesArtifactsToHandle,
+            nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo, nodeName);
     }
 
     @Test
-    public void testHandleNestedVfc1() {
+    void testHandleNestedVfc1() {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Resource resource = createParseResourceObject(false);
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
@@ -1009,12 +1147,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         nodesInfo.put(nodeName, nodeTypeInfo);
         CsarInfo csarInfo = getCsarInfo();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.handleNestedVfc(resource,
-                nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.handleNestedVfc(resource,
+            nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
     }
 
     @Test
-    public void testHandleComplexVfc1() {
+    void testHandleComplexVfc1() {
         Resource resource = createParseResourceObject(true);
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
@@ -1023,48 +1161,31 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         when(serviceImportParseLogic.buildValidComplexVfc(any(Resource.class), any(CsarInfo.class), anyString(),
-                anyMap())).thenReturn(createParseResourceObject(false));
+            anyMap())).thenReturn(createParseResourceObject(false));
         when(toscaOperationFacade.getFullLatestComponentByToscaResourceName(anyString()))
-                .thenReturn(Either.left(resource));
+            .thenReturn(Either.left(resource));
         when(serviceImportParseLogic.validateNestedDerivedFromDuringUpdate(any(Resource.class), any(Resource.class),
-                anyBoolean())).thenReturn(Either.left(true));
+            anyBoolean())).thenReturn(Either.left(true));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.handleComplexVfc(resource,
-                nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName, yamlName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.handleComplexVfc(resource,
+            nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName, yamlName));
     }
 
     @Test
-    public void testCreateResourcesFromYamlNodeTypesList1() {
-        String yamlName = "group.yml";
-        Resource resource = createParseResourceObject(false);
-        Map<String, Object> mappedToscaTemplate = new HashMap<>();
-        boolean needLock = true;
-        Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
-        List<ArtifactDefinition> nodeTypesNewCreatedArtifacts = new ArrayList<>();
-        Map<String, NodeTypeInfo> nodeTypesInfo = new HashMap<>();
-        CsarInfo csarInfo = getCsarInfo();
-
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourcesFromYamlNodeTypesList(yamlName, resource, mappedToscaTemplate, needLock,
-                        nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo));
-
-    }
-
-    @Test
-    public void testCreateNodeTypes1() {
+    void testCreateNodeTypes1() {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(false);
         boolean needLock = true;
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>> enumListEnumMap =
-                new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         List<ArtifactDefinition> artifactDefinitions = new ArrayList<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
         artifactDefinition.setArtifactName("artifactName");
         artifactDefinitions.add(artifactDefinition);
         enumListEnumMap.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE,
-                artifactDefinitions);
+            artifactDefinitions);
         nodeTypesArtifactsToHandle.put("nodeTyp", enumListEnumMap);
         List<ArtifactDefinition> nodeTypesNewCreatedArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
@@ -1079,13 +1200,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         nodeTypes.put(nodeName, "");
         Assertions.assertNotNull(resource);
 
-        sIB1.createNodeTypes(yamlName,
-                resource, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
-                nodeTypesInfo, csarInfo, mapToConvert, nodeTypes);
+        sIBL.createNodeTypes(yamlName,
+            resource, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
+            nodeTypesInfo, csarInfo, mapToConvert, nodeTypes);
     }
 
     @Test
-    public void testCreateNodeTypeResourceFromYaml() throws IOException {
+    void testCreateNodeTypeResourceFromYaml() throws IOException {
         String yamlName = "group.yml";
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Map<String, Object> nodeMap = new HashMap<>();
@@ -1103,22 +1224,23 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         resourceMetaData.setResourceType("VFC");
         ImmutablePair<Resource, ActionStatus> immutablePair = new ImmutablePair<>(resourceVf, ActionStatus.CREATED);
         when(serviceImportParseLogic.fillResourceMetadata(anyString(), any(Resource.class), anyString(), any(User.class)))
-                .thenReturn(resourceMetaData);
+            .thenReturn(resourceMetaData);
         when(serviceImportParseLogic.buildNodeTypeYaml(any(Map.Entry.class), anyMap(), anyString(), any(CsarInfo.class)))
-                .thenReturn(nodeName);
+            .thenReturn(nodeName);
         when(serviceBusinessLogic.validateUser(any(User.class), anyString(), any(Component.class), any(AuditingActionEnum.class),
-                anyBoolean())).thenReturn(user);
-        when(serviceImportParseLogic.createResourceFromNodeType(anyString(), any(UploadResourceInfo.class), any(User.class), anyBoolean(), anyBoolean(),
-                anyMap(), anyList(), anyBoolean(), any(CsarInfo.class),
-                anyString(), anyBoolean())).thenReturn(immutablePair);
+            anyBoolean())).thenReturn(user);
+        when(serviceImportParseLogic.createResourceFromNodeType(anyString(), any(UploadResourceInfo.class), any(User.class), anyBoolean(),
+            anyBoolean(),
+            anyMap(), anyList(), anyBoolean(), any(CsarInfo.class),
+            anyString(), anyBoolean())).thenReturn(immutablePair);
         Assertions.assertNotNull(
-                sIB1.createNodeTypeResourceFromYaml(yamlName, nodeNameValue, user, mapToConvert,
-                        resourceVf, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts,
-                        forceCertificationAllowed, csarInfo, isNested));
+            sIBL.createNodeTypeResourceFromYaml(yamlName, nodeNameValue, user, mapToConvert,
+                resourceVf, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts,
+                forceCertificationAllowed, csarInfo, isNested));
     }
 
     @Test
-    public void testCreateRIAndRelationsFromYaml() {
+    void testCreateRIAndRelationsFromYaml() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Map<String, UploadComponentInstanceInfo> uploadComponentInstanceInfoMap = new HashMap<>();
@@ -1130,14 +1252,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToCreate = new HashMap<>();
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
 
-        Assertions.assertNotNull(sIB1
+        Assertions.assertNotNull(sIBL
             .createRIAndRelationsFromYaml(yamlName, service, uploadComponentInstanceInfoMap,
                 topologyTemplateYaml, nodeTypesNewCreatedArtifacts, nodeTypesInfo,
                 csarInfo, nodeTypesArtifactsToCreate, nodeName));
     }
 
     @Test
-    public void testCreateServiceInstancesRelations() {
+    void testCreateServiceInstancesRelations() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         service.setComponentInstances(creatComponentInstances());
@@ -1154,30 +1276,29 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         when(serviceImportParseLogic.getResourceAfterCreateRelations(any(Resource.class))).thenReturn(newResource);
         when(serviceImportParseLogic.getComponentFilterAfterCreateRelations()).thenReturn(componentParametersView);
         when(toscaOperationFacade.getToscaElement(anyString(), any(ComponentParametersView.class))).thenReturn(Either.left(service));
-        when(serviceImportParseLogic.findAviableRequiremen(anyString(),
-                anyString(), any(UploadComponentInstanceInfo.class), any(ComponentInstance.class),
-                anyString())).thenReturn(Either.left(requirementDefinition));
+        when(serviceImportParseLogic.findAvailableRequirement(anyString(),
+            anyString(), any(UploadComponentInstanceInfo.class), any(ComponentInstance.class),
+            anyString())).thenReturn(Either.left(requirementDefinition));
         when(serviceImportParseLogic.findAvailableCapabilityByTypeOrName(any(RequirementDefinition.class),
-                any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
+            any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
         when(componentsUtils.getResponseFormat(any(ActionStatus.class), anyString())).thenReturn(responseFormat);
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(service));
-        Assertions.assertNotNull(sIB1
-                .createServiceInstancesRelations(user, yamlName, service, uploadResInstancesMap));
+        Assertions.assertNotNull(sIBL.createServiceInstancesRelations(user, yamlName, service, uploadResInstancesMap, null));
     }
 
     @Test
-    public void testCreateServiceInstancesRelations_Empty() {
+    void testCreateServiceInstancesRelations_Empty() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         service.setComponentInstances(creatComponentInstances());
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createServiceInstancesRelations(user, yamlName, service, uploadResInstancesMap));
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.createServiceInstancesRelations(user, yamlName, service, uploadResInstancesMap, null));
     }
 
     @Test
-    public void testProcessComponentInstance() {
+    void testProcessComponentInstance() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -1194,6 +1315,7 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Map<String, ArtifactDefinition>> instDeploymentArtifacts = new HashMap<>();
         Map<String, Map<String, ArtifactDefinition>> instArtifacts = new HashMap<>();
         Map<String, List<AttributeDefinition>> instAttributes = new HashMap<>();
+        Map<String, UploadNodeFilterInfo> instNodeFilter = new HashMap<>();
         Map<String, Resource> originCompMap = new HashMap<>();
         originCompMap.put("componentUid", originResource);
         Map<String, List<ComponentInstanceInput>> instInputs = new HashMap<>();
@@ -1201,14 +1323,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         uploadComponentInstanceInfo.setName("zxjTestImportServiceAb");
         Assertions.assertNotNull(service);
 
-        sIB1.processComponentInstance(yamlName, service, componentInstancesList, allDataTypes.left().value(),
-                instProperties, instCapabilties, instRequirements, instDeploymentArtifacts,
-                instArtifacts, instAttributes, originCompMap, instInputs,
-                uploadComponentInstanceInfo);
+        sIBL.processComponentInstance(yamlName, service, componentInstancesList, allDataTypes.left().value(),
+            instProperties, instCapabilties, instRequirements, instDeploymentArtifacts,
+            instArtifacts, instAttributes, originCompMap, instInputs, instNodeFilter, null,
+            uploadComponentInstanceInfo);
     }
 
     @Test
-    public void testProcessComponentInstance_null2() {
+    void testProcessComponentInstance_null2() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -1220,20 +1342,21 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Map<String, ArtifactDefinition>> instDeploymentArtifacts = new HashMap<>();
         Map<String, Map<String, ArtifactDefinition>> instArtifacts = new HashMap<>();
         Map<String, List<AttributeDefinition>> instAttributes = new HashMap<>();
+        Map<String, UploadNodeFilterInfo> instNodeFilter = new HashMap<>();
         Map<String, Resource> originCompMap = new HashMap<>();
         originCompMap.put("componentUid", originResource);
         Map<String, List<ComponentInstanceInput>> instInputs = new HashMap<>();
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         uploadComponentInstanceInfo.setName("zxjTestImportServiceAb0");
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.processComponentInstance(yamlName,
-                service, componentInstancesList, null, instProperties, instCapabilties,
-                instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes, originCompMap,
-                instInputs, uploadComponentInstanceInfo));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.processComponentInstance(yamlName,
+            service, componentInstancesList, null, instProperties, instCapabilties,
+            instRequirements, instDeploymentArtifacts, instArtifacts, instAttributes, originCompMap,
+            instInputs, instNodeFilter, null, uploadComponentInstanceInfo));
     }
 
     @Test
-    public void testAddInputsValuesToRi2() {
+    void testAddInputsValuesToRi2() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         Map<String, List<UploadPropInfo>> properties = new HashMap<>();
         List<UploadPropInfo> uploadPropInfoList = new ArrayList<>();
@@ -1254,13 +1377,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, List<ComponentInstanceInput>> instInputs = new HashMap<>();
         Map<String, DataTypeDefinition> allDataTypes = new HashMap<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .addInputsValuesToRi(uploadComponentInstanceInfo, resource, originResource,
-                        currentCompInstance, instInputs, allDataTypes));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .addInputsValuesToRi(uploadComponentInstanceInfo, resource, originResource,
+                currentCompInstance, instInputs, allDataTypes));
     }
 
     @Test
-    public void testProcessProperty2() {
+    void testProcessProperty2() {
         Service resource = createServiceObject(true);
         List<InputDefinition> inputs = new ArrayList<>();
         ComponentInstance currentCompInstance = null;
@@ -1286,21 +1409,20 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         propertyList.add(propertyInfo);
         Assertions.assertNotNull(resource);
 
-        sIB1.processProperty(resource, currentCompInstance, allDataTypes, currPropertiesMap, instPropList, propertyList);
+        sIBL.processProperty(resource, allDataTypes, currPropertiesMap, instPropList, propertyList);
     }
 
     @Test
-    public void testProcessGetInput() {
+    void testProcessGetInput() {
         List<GetInputValueDataDefinition> getInputValues = new ArrayList<>();
         List<InputDefinition> inputs = new ArrayList<>();
         GetInputValueDataDefinition getInputIndex = new GetInputValueDataDefinition();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.processGetInput(getInputValues,
-                inputs, getInputIndex));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.processGetInput(getInputValues, inputs, getInputIndex));
     }
 
     @Test
-    public void testProcessGetInput_optional() {
+    void testProcessGetInput_optional() {
         List<GetInputValueDataDefinition> getInputValues = new ArrayList<>();
         List<InputDefinition> inputs = new ArrayList<>();
         InputDefinition inputDefinition = new InputDefinition();
@@ -1311,11 +1433,11 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         getInputIndex.setInputName("InputName");
         Assertions.assertNotNull(inputs);
 
-        sIB1.processGetInput(getInputValues, inputs, getInputIndex);
+        sIBL.processGetInput(getInputValues, inputs, getInputIndex);
     }
 
     @Test
-    public void testAddPropertyValuesToRi() {
+    void testAddPropertyValuesToRi() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         uploadComponentInstanceInfo.setProperties(getUploadPropInfoProperties());
         Resource resource = createParseResourceObject(true);
@@ -1332,16 +1454,16 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, List<ComponentInstanceProperty>> instProperties = new HashMap<>();
         Map<String, DataTypeDefinition> allDataTypes = new HashMap<>();
         ResponseFormat responseFormat = new ResponseFormat();
-        when(serviceImportParseLogic.findInputByName(anyList(), any(GetInputValueDataDefinition.class)))
-                .thenReturn(inputDefinition);
+        when(serviceImportParseLogic.findInputByName(eq(inputs), any(GetInputValueDataDefinition.class)))
+            .thenReturn(inputDefinition);
         when(componentsUtils.getResponseFormat(any(ActionStatus.class))).thenReturn(responseFormat);
         Assertions.assertNotNull(
-                sIB1.addPropertyValuesToRi(uploadComponentInstanceInfo, resource, originResource,
-                        currentCompInstance, instProperties, allDataTypes));
+            sIBL.addPropertyValuesToRi(uploadComponentInstanceInfo, resource, originResource,
+                currentCompInstance, instProperties, allDataTypes));
     }
 
     @Test
-    public void testAddPropertyValuesToRi_else() {
+    void testAddPropertyValuesToRi_else() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         Resource resource = createParseResourceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -1352,13 +1474,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ResponseFormat responseFormat = new ResponseFormat();
         when(componentsUtils.getResponseFormat(any(ActionStatus.class))).thenReturn(responseFormat);
         Assertions.assertNotNull(
-                sIB1.addPropertyValuesToRi(uploadComponentInstanceInfo, resource, originResource, currentCompInstance,
-                        instProperties, allDataTypes));
-
+            sIBL.addPropertyValuesToRi(uploadComponentInstanceInfo, resource, originResource, currentCompInstance,
+                instProperties, allDataTypes));
     }
 
     @Test
-    public void testAddPropertyValuesToRi2() {
+    void testAddPropertyValuesToRi2() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         uploadComponentInstanceInfo.setProperties(getUploadPropInfoProperties());
         Service service = createServiceObject(true);
@@ -1377,14 +1498,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ResponseFormat responseFormat = new ResponseFormat();
         when(componentsUtils.getResponseFormat(any(ActionStatus.class))).thenReturn(responseFormat);
         when(serviceImportParseLogic.findInputByName(anyList(), any(GetInputValueDataDefinition.class)))
-                .thenReturn(inputDefinition);
+            .thenReturn(inputDefinition);
         Assertions.assertNotNull(
-                sIB1.addPropertyValuesToRi(uploadComponentInstanceInfo, service, originResource,
-                        currentCompInstance, instProperties, allDataTypes));
+            sIBL.addPropertyValuesToRi(uploadComponentInstanceInfo, service, originResource,
+                currentCompInstance, instProperties, allDataTypes));
     }
 
     @Test
-    public void testAddPropertyValuesToRi2_else() {
+    void testAddPropertyValuesToRi2_else() {
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
         Service service = createServiceObject(true);
         Resource originResource = createParseResourceObject(false);
@@ -1395,12 +1516,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ResponseFormat responseFormat = new ResponseFormat();
         when(componentsUtils.getResponseFormat(any(ActionStatus.class))).thenReturn(responseFormat);
         Assertions.assertNotNull(
-                sIB1.addPropertyValuesToRi(uploadComponentInstanceInfo, service, originResource, currentCompInstance,
-                        instProperties, allDataTypes));
+            sIBL.addPropertyValuesToRi(uploadComponentInstanceInfo, service, originResource, currentCompInstance,
+                instProperties, allDataTypes));
     }
 
     @Test
-    public void testProcessComponentInstanceCapabilities() {
+    void testProcessComponentInstanceCapabilities() {
         Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> allDataTypes = null;
         Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> instCapabilties = new HashMap<>();
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
@@ -1408,12 +1529,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         ComponentInstance currentCompInstance = new ComponentInstance();
         Resource originResource = createParseResourceObject(false);
         Assertions.assertNotNull(originResource);
-        sIB1.processComponentInstanceCapabilities(null, instCapabilties,
-                uploadComponentInstanceInfo, currentCompInstance, originResource);
+        sIBL.processComponentInstanceCapabilities(null, instCapabilties, uploadComponentInstanceInfo, currentCompInstance,
+            originResource);
     }
 
     @Test
-    public void testProcessComponentInstanceCapabilities_null() {
+    void testProcessComponentInstanceCapabilities_null() {
         Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> allDataTypes = null;
         Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> instCapabilties = new HashMap<>();
         UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
@@ -1421,86 +1542,106 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Resource originResource = createParseResourceObject(false);
         Assertions.assertNotNull(originResource);
 
-        sIB1.processComponentInstanceCapabilities(null, instCapabilties, uploadComponentInstanceInfo,
-                currentCompInstance, originResource);
+        sIBL.processComponentInstanceCapabilities(null, instCapabilties, uploadComponentInstanceInfo, currentCompInstance,
+            originResource);
+    }
+
+    @Test
+    void testProcessComponentInstanceInterfaces() {
+        Service service = createServiceObject(true);
+        service.setModel("testModel");
+        Map<String, Map<String, InterfaceDefinition>> instInterfaces = new HashMap<>();
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
+        uploadComponentInstanceInfo.setInterfaces(getInterfaces());
+        ComponentInstance currentCompInstance = new ComponentInstance();
+        Resource originResource = createParseResourceObject(false);
+        Assertions.assertNotNull(originResource);
+
+        InterfaceDefinition interfaceDef = new InterfaceDefinition();
+        interfaceDef.setUniqueId("tosca.interfaces.lifecycle.TestInterface");
+        Map<String, InterfaceDefinition> interfaceLifecycleTypes = new HashMap<>();
+        interfaceLifecycleTypes.put("tosca.interfaces.lifecycle.TestInterface", interfaceDef);
+        when(interfaceLifecycleTypeOperation.getAllInterfaceLifecycleTypes("testModel")).thenReturn(Either.left(interfaceLifecycleTypes));
+
+        sIBL.addInterfaceValuesToRi(uploadComponentInstanceInfo, service, originResource, currentCompInstance, instInterfaces);
+    }
+
+    @Test
+    void testProcessComponentInstanceInterfaces_null() {
+        Service service = createServiceObject(true);
+        Map<String, Map<String, InterfaceDefinition>> instInterfaces = new HashMap<>();
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
+        ComponentInstance currentCompInstance = new ComponentInstance();
+        Resource originResource = createParseResourceObject(false);
+        Assertions.assertNotNull(originResource);
+        sIBL.addInterfaceValuesToRi(uploadComponentInstanceInfo, service, originResource, currentCompInstance, instInterfaces);
     }
 
     @Test
-    public void testUpdateCapabilityPropertiesValues() {
+    void testUpdateCapabilityPropertiesValues() {
         Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> allDataTypes = null;
         Map<String, List<CapabilityDefinition>> originCapabilities = new HashMap<>();
         Map<String, Map<String, UploadPropInfo>> newPropertiesMap = new HashMap<>();
         Assertions.assertNull(allDataTypes);
-        sIB1.updateCapabilityPropertiesValues(null, originCapabilities, newPropertiesMap, null);
+        sIBL.updateCapabilityPropertiesValues(null, originCapabilities, newPropertiesMap);
     }
 
     @Test
-    public void testUpdatePropertyValues() {
+    void testUpdatePropertyValues() {
         List<ComponentInstanceProperty> properties = new ArrayList<>();
         Map<String, UploadPropInfo> newProperties = new HashMap<>();
         Map<String, DataTypeDefinition> allDataTypes = new HashMap<>();
         Assertions.assertNotNull(allDataTypes);
-        sIB1.updatePropertyValues(properties, newProperties, allDataTypes);
+        sIBL.updatePropertyValues(properties, newProperties, allDataTypes);
     }
 
     @Test
-    public void testUpdatePropertyValue() {
+    void testUpdatePropertyValue() {
         ComponentInstanceProperty property = new ComponentInstanceProperty();
         property.setType("services");
         UploadPropInfo propertyInfo = new UploadPropInfo();
         propertyInfo.setValue("value");
         Map<String, DataTypeDefinition> allDataTypes = new HashMap<>();
-        when(serviceBusinessLogic.validatePropValueBeforeCreate(any(IPropertyInputCommon.class), anyString(), anyBoolean(), anyMap())).thenReturn("qw");
-        Assertions.assertNotNull(
-                sIB1.updatePropertyValue(property, propertyInfo, allDataTypes));
+        when(serviceBusinessLogic.validatePropValueBeforeCreate(any(IPropertyInputCommon.class), anyString(), anyBoolean(), anyMap())).thenReturn(
+            "qw");
+        Assertions.assertNotNull(sIBL.updatePropertyValue(property, propertyInfo, allDataTypes));
     }
 
     @Test
-    public void testGetOriginResource() {
+    void testGetOriginResource() {
         String yamlName = "group.yml";
         Map<String, Resource> originCompMap = new HashMap<>();
         ComponentInstance currentCompInstance = new ComponentInstance();
         currentCompInstance.setComponentUid("currentCompInstance");
         when(toscaOperationFacade.getToscaFullElement(anyString()))
-                .thenReturn(Either.left(createParseResourceObject(true)));
-        Assertions.assertNotNull(
-                sIB1.getOriginResource(yamlName, originCompMap, currentCompInstance));
-    }
-
-    @Test
-    public void testHandleSubstitutionMappings2() {
-        Service service = createServiceObject(true);
-        Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        Assertions.assertNotNull(service);
-
-        sIB1.handleSubstitutionMappings(service, uploadResInstancesMap);
+            .thenReturn(Either.left(createParseResourceObject(true)));
+        Assertions.assertNotNull(sIBL.getOriginResource(yamlName, originCompMap, currentCompInstance));
     }
 
     @Test
-    public void testUpdateCalculatedCapReqWithSubstitutionMappings() {
+    void testUpdateCalculatedCapReqWithSubstitutionMappings() {
         Resource resource = createParseResourceObject(false);
         resource.setComponentInstances(creatComponentInstances());
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = getUploadResInstancesMap();
 
         when(toscaOperationFacade.deleteAllCalculatedCapabilitiesRequirements(any())).thenReturn(StorageOperationStatus.OK);
-        Assertions.assertNotNull(
-                sIB1.updateCalculatedCapReqWithSubstitutionMappings(resource, uploadResInstancesMap));
+        Assertions.assertNotNull(sIBL.updateCalculatedCapReqWithSubstitutionMappings(resource, uploadResInstancesMap));
     }
 
     @Test
-    public void testFillUpdatedInstCapabilitiesRequirements() {
+    void testFillUpdatedInstCapabilitiesRequirements() {
         List<ComponentInstance> componentInstances = creatComponentInstances();
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = getUploadResInstancesMap();
         Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> updatedInstCapabilities = new HashMap<>();
         Map<ComponentInstance, Map<String, List<RequirementDefinition>>> updatedInstRequirement = new HashMap<>();
         Assertions.assertNotNull(componentInstances);
 
-        sIB1.fillUpdatedInstCapabilitiesRequirements(componentInstances, uploadResInstancesMap,
-                updatedInstCapabilities, updatedInstRequirement);
+        sIBL.fillUpdatedInstCapabilitiesRequirements(componentInstances, uploadResInstancesMap,
+            updatedInstCapabilities, updatedInstRequirement);
     }
 
     @Test
-    public void testFillUpdatedInstCapabilities() {
+    void testFillUpdatedInstCapabilities() {
         Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> updatedInstCapabilties = new HashMap<>();
         Map<String, List<CapabilityDefinition>> capabilities = new HashMap<>();
         List<CapabilityDefinition> capabilityDefinitionList = new ArrayList<>();
@@ -1514,13 +1655,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         capabilitiesNamesToUpdate.put("mme_ipu_vdu.feature", "capabilitiesNamesToUpdate");
         Assertions.assertNotNull(instance);
 
-        sIB1.fillUpdatedInstCapabilities(updatedInstCapabilties, instance, capabilitiesNamesToUpdate);
+        sIBL.fillUpdatedInstCapabilities(updatedInstCapabilties, instance, capabilitiesNamesToUpdate);
     }
 
     @Test
-    public void testFillUpdatedInstRequirements() {
+    void testFillUpdatedInstRequirements() {
         Map<ComponentInstance, Map<String, List<RequirementDefinition>>> updatedInstRequirements = new
-                HashMap<>();
+            HashMap<>();
         ComponentInstance instance = new ComponentInstance();
         Map<String, List<RequirementDefinition>> requirements = new HashMap<>();
         List<RequirementDefinition> requirementDefinitionList = new ArrayList<>();
@@ -1531,19 +1672,19 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         instance.setRequirements(requirements);
         Map<String, String> requirementsNamesToUpdate = new HashMap<>();
         requirementsNamesToUpdate.put("zxjtestimportserviceab0.mme_ipu_vdu.dependency.test",
-                "requirementsNamesToUpdate");
+            "requirementsNamesToUpdate");
         Assertions.assertNotNull(instance);
 
-        sIB1.fillUpdatedInstRequirements(updatedInstRequirements, instance, requirementsNamesToUpdate);
+        sIBL.fillUpdatedInstRequirements(updatedInstRequirements, instance, requirementsNamesToUpdate);
     }
 
     @Test
-    public void testAddRelationsToRI() {
+    void testAddRelationsToRI() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
 
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        UploadComponentInstanceInfo nodesInfoValue = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo nodesInfoValue = getUploadComponentInstanceInfo();
         uploadResInstancesMap.put("uploadComponentInstanceInfo", nodesInfoValue);
         List<ComponentInstance> componentInstancesList = creatComponentInstances();
         ComponentInstance componentInstance = new ComponentInstance();
@@ -1561,38 +1702,38 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         capabilityDefinition.setOwnerId("6");
         ResponseFormat responseFormat = new ResponseFormat();
         responseFormat.setStatus(200);
-        when(serviceImportParseLogic.findAviableRequiremen(anyString(),
-                anyString(), any(UploadComponentInstanceInfo.class), any(ComponentInstance.class),
-                anyString())).thenReturn(Either.left(requirementDefinition));
+        when(serviceImportParseLogic.findAvailableRequirement(anyString(),
+            anyString(), any(UploadComponentInstanceInfo.class), any(ComponentInstance.class),
+            anyString())).thenReturn(Either.left(requirementDefinition));
         when(serviceImportParseLogic.findAvailableCapabilityByTypeOrName(any(RequirementDefinition.class),
-                any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
+            any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
         when(componentsUtils.getResponseFormat(any(ActionStatus.class), anyString())).thenReturn(responseFormat);
         Assertions.assertNotNull(service);
 
-        sIB1.addRelationsToRI(yamlName, service, uploadResInstancesMap, componentInstancesList, relations);
+        sIBL.addRelationsToRI(yamlName, service, uploadResInstancesMap, componentInstancesList, relations);
     }
 
     @Test
-    public void testAddRelationsToRI_null() {
+    void testAddRelationsToRI_null() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        UploadComponentInstanceInfo nodesInfoValue = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo nodesInfoValue = getUploadComponentInstanceInfo();
         uploadResInstancesMap.put("uploadComponentInstanceInfo", nodesInfoValue);
         List<ComponentInstance> componentInstancesList = new ArrayList<>();
         List<RequirementCapabilityRelDef> relations = new ArrayList<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.addRelationsToRI(yamlName,
-                service, uploadResInstancesMap, componentInstancesList, relations));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.addRelationsToRI(yamlName,
+            service, uploadResInstancesMap, componentInstancesList, relations));
     }
 
     @Test
-    public void testAddRelationToRI() {
+    void testAddRelationToRI() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         service.setComponentInstances(creatComponentInstances());
 
-        UploadComponentInstanceInfo nodesInfoValue = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo nodesInfoValue = getUploadComponentInstanceInfo();
         List<RequirementCapabilityRelDef> relations = new ArrayList<>();
         RequirementDefinition requirementDefinition = new RequirementDefinition();
         requirementDefinition.setName("zxjtestimportserviceab0.mme_ipu_vdu.dependency.test");
@@ -1601,60 +1742,57 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         capabilityDefinition.setUniqueId("capabilityDefinitionUniqueId");
         capabilityDefinition.setOwnerId("capabilityDefinitionOwnerId");
         ResponseFormat responseFormat = new ResponseFormat();
-        when(serviceImportParseLogic.findAviableRequiremen(anyString(), anyString(), any(UploadComponentInstanceInfo.class),
-                any(ComponentInstance.class), anyString())).thenReturn(Either.left(requirementDefinition));
+        when(serviceImportParseLogic.findAvailableRequirement(anyString(), anyString(), any(UploadComponentInstanceInfo.class),
+            any(ComponentInstance.class), anyString())).thenReturn(Either.left(requirementDefinition));
         when(serviceImportParseLogic.findAvailableCapabilityByTypeOrName(any(RequirementDefinition.class),
-                any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
+            any(ComponentInstance.class), any(UploadReqInfo.class))).thenReturn(capabilityDefinition);
         when(componentsUtils.getResponseFormat(any(ActionStatus.class), anyString())).thenReturn(responseFormat);
-        Assertions.assertNotNull(
-                sIB1.addRelationToRI(yamlName, service, nodesInfoValue, relations));
+        Assertions.assertNotNull(sIBL.addRelationToRI(yamlName, service, nodesInfoValue, relations));
+        Assertions.assertNotNull(relations.get(0).getRelationships().get(0).getOperations());
     }
 
     @Test
-    public void testAddRelationToRI_null() {
+    void testAddRelationToRI_null() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         List<ComponentInstance> componentInstancesList = new ArrayList<>();
         service.setComponentInstances(componentInstancesList);
         ResponseFormat responseFormat = new ResponseFormat();
-        UploadComponentInstanceInfo nodesInfoValue = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo nodesInfoValue = getUploadComponentInstanceInfo();
         List<RequirementCapabilityRelDef> relations = new ArrayList<>();
         when(componentsUtils.getResponseFormat(any(ActionStatus.class), anyString())).thenReturn(responseFormat);
-        Assertions.assertNotNull(
-                sIB1.addRelationToRI(yamlName, service, nodesInfoValue, relations));
-
+        Assertions.assertNotNull(sIBL.addRelationToRI(yamlName, service, nodesInfoValue, relations));
     }
 
     @Test
-    public void testGetResourceAfterCreateRelations() {
+    void testGetResourceAfterCreateRelations() {
         Service service = createServiceObject(true);
         ComponentParametersView componentParametersView = createComponentParametersView();
         when(serviceImportParseLogic.getComponentFilterAfterCreateRelations()).thenReturn(componentParametersView);
         when(toscaOperationFacade.getToscaElement(anyString(), any(ComponentParametersView.class)))
-                .thenReturn(Either.left(createServiceObject(true)));
-        Assertions.assertNotNull(
-                sIB1.getResourceAfterCreateRelations(service));
+            .thenReturn(Either.left(createServiceObject(true)));
+        Assertions.assertNotNull(sIBL.getResourceAfterCreateRelations(service));
     }
 
     @Test
-    public void testCreateServiceInstances() {
+    void testCreateServiceInstances() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        UploadComponentInstanceInfo nodesInfoValue = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo nodesInfoValue = getUploadComponentInstanceInfo();
         uploadResInstancesMap.put("uploadResInstancesMap", nodesInfoValue);
         Map<String, Resource> nodeNamespaceMap = new HashMap<>();
         Resource resource = createParseResourceObject(true);
         resource.setToscaResourceName("toscaResourceName");
         nodeNamespaceMap.put("nodeNamespaceMap", resource);
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createServiceInstances(yamlName, service, uploadResInstancesMap, nodeNamespaceMap));
+        Assertions.assertThrows(ComponentException.class,
+            () -> sIBL.createServiceInstances(yamlName, service, uploadResInstancesMap, nodeNamespaceMap));
     }
 
     @Test
-    public void testCreateAndAddResourceInstance() {
-        UploadComponentInstanceInfo uploadComponentInstanceInfo = getuploadComponentInstanceInfo();
+    void testCreateAndAddResourceInstance() {
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = getUploadComponentInstanceInfo();
         String yamlName = "group.yml";
         Resource resource = createParseResourceObject(false);
         Resource originResource = createParseResourceObject(true);
@@ -1664,14 +1802,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Resource> existingnodeTypeMap = new HashMap<>();
         Map<ComponentInstance, Resource> resourcesInstancesMap = new HashMap<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createAndAddResourceInstance(uploadComponentInstanceInfo, yamlName, resource,
-                        nodeNamespaceMap, existingnodeTypeMap, resourcesInstancesMap));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createAndAddResourceInstance(uploadComponentInstanceInfo, yamlName, resource,
+                nodeNamespaceMap, existingnodeTypeMap, resourcesInstancesMap));
     }
 
     @Test
-    public void testCreateAndAddResourceInstances() {
-        UploadComponentInstanceInfo uploadComponentInstanceInfo = getuploadComponentInstanceInfo();
+    void testCreateAndAddResourceInstances() {
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = getUploadComponentInstanceInfo();
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         service.setServiceType("services");
@@ -1682,15 +1820,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Resource> existingnodeTypeMap = new HashMap<>();
         Map<ComponentInstance, Resource> resourcesInstancesMap = new HashMap<>();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createAndAddResourceInstance(uploadComponentInstanceInfo, yamlName, service,
-                        nodeNamespaceMap, existingnodeTypeMap, resourcesInstancesMap));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createAndAddResourceInstance(uploadComponentInstanceInfo, yamlName, service,
+                nodeNamespaceMap, existingnodeTypeMap, resourcesInstancesMap));
     }
 
     @Test
-    public void testValidateResourceInstanceBeforeCreate() {
+    void testValidateResourceInstanceBeforeCreate() {
         String yamlName = "group.yml";
-        UploadComponentInstanceInfo uploadComponentInstanceInfo = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = getUploadComponentInstanceInfo();
         Resource originResource = createParseResourceObject(true);
         ResourceMetadataDataDefinition componentMetadataDataDefinition = new ResourceMetadataDataDefinition();
         componentMetadataDataDefinition.setState(LifecycleStateEnum.CERTIFIED.name());
@@ -1699,17 +1837,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         originResource.setComponentType(ComponentTypeEnum.RESOURCE);
         originResource.setToscaResourceName("toscaResourceName");
         originResource.setResourceType(ResourceTypeEnum.VF);
-        originResource.setResourceType(ResourceTypeEnum.VF);
         Map<String, Resource> nodeNamespaceMap = new HashMap<>();
         nodeNamespaceMap.put("resources", originResource);
-        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString()))
-                .thenReturn(Either.left(originResource));
+        when(toscaOperationFacade.getLatestByToscaResourceName(RESOURCE_TOSCA_NAME, null)).thenReturn(Either.left(originResource));
         Assertions.assertNotNull(
-                sIB1.validateResourceInstanceBeforeCreate(yamlName, uploadComponentInstanceInfo, nodeNamespaceMap));
+            sIBL.validateResourceInstanceBeforeCreate(yamlName, null, uploadComponentInstanceInfo, nodeNamespaceMap));
     }
 
     @Test
-    public void testHandleServiceNodeTypes() {
+    void testHandleServiceNodeTypes() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         String topologyTemplateYaml = getMainTemplateContent("service_import_template.yml");
@@ -1720,24 +1856,23 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
         CsarInfo csarInfo = getCsarInfo();
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
-        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString()))
-                .thenReturn(Either.left(createOldResource()));
+        when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(createOldResource()));
         Assertions.assertNotNull(service);
 
-        sIB1.handleServiceNodeTypes(yamlName, service, topologyTemplateYaml, needLock,
-                nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts, nodeTypesInfo,
-                csarInfo, nodeName);
+        sIBL.handleServiceNodeTypes(yamlName, service, topologyTemplateYaml, needLock, nodeTypesArtifactsToHandle,
+            nodeTypesNewCreatedArtifacts,
+            nodeTypesInfo, csarInfo, nodeName);
     }
 
     @Test
-    public void testValidateResourceNotExisted() {
+    void testValidateResourceNotExisted() {
         String type = "org.openecomp.resource.vf";
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.validateResourceNotExisted(type));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.validateResourceNotExisted(type));
     }
 
     @Test
-    public void testHandleNestedVF() {
+    void testHandleNestedVF() {
         Service service = createServiceObject(true);
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
@@ -1745,12 +1880,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         CsarInfo csarInfo = getCsarInfo();
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.handleNestedVF(service,
-                nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.handleNestedVF(service,
+            nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
     }
 
     @Test
-    public void testHandleNestedVfc() {
+    void testHandleNestedVfc() {
         Service service = createServiceObject(true);
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
@@ -1758,12 +1893,12 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         CsarInfo csarInfo = getCsarInfo();
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.handleNestedVfc(service,
-                nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.handleNestedVfc(service,
+            nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo, csarInfo, nodeName));
     }
 
     @Test
-    public void testHandleComplexVfc() {
+    void testHandleComplexVfc() {
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodesInfo = new HashMap<>();
@@ -1771,19 +1906,19 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         when(serviceImportParseLogic.buildValidComplexVfc(any(CsarInfo.class), anyString(), anyMap()))
-                .thenReturn(createNewResource());
+            .thenReturn(createNewResource());
         when(toscaOperationFacade.getFullLatestComponentByToscaResourceName(anyString()))
-                .thenReturn(Either.left(createNewResource()));
+            .thenReturn(Either.left(createNewResource()));
         when(serviceImportParseLogic.validateNestedDerivedFromDuringUpdate(any(Resource.class), any(Resource.class), anyBoolean()))
-                .thenReturn(Either.left(true));
+            .thenReturn(Either.left(true));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
-                        csarInfo, nodeName, yamlName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
+                csarInfo, nodeName, yamlName));
     }
 
     @Test
-    public void testHandleComplexVfcStatus() {
+    void testHandleComplexVfcStatus() {
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodesInfo = new HashMap<>();
@@ -1791,17 +1926,17 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         when(serviceImportParseLogic.buildValidComplexVfc(any(CsarInfo.class), anyString(), anyMap()))
-                .thenReturn(createNewResource());
+            .thenReturn(createNewResource());
         when(toscaOperationFacade.getFullLatestComponentByToscaResourceName(anyString()))
-                .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
+            .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
-                        csarInfo, nodeName, yamlName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
+                csarInfo, nodeName, yamlName));
     }
 
     @Test
-    public void testHandleComplexVfc2() {
+    void testHandleComplexVfc2() {
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodesInfo = getNodeTypesInfo();
@@ -1814,13 +1949,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Resource oldComplexVfc = createParseResourceObject(false);
         Resource newComplexVfc = createParseResourceObject(true);
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
-                        csarInfo, nodeName, yamlName, oldComplexVfc, newComplexVfc));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .handleComplexVfc(nodeTypesArtifactsToHandle, createdArtifacts, nodesInfo,
+                csarInfo, nodeName, yamlName, oldComplexVfc, newComplexVfc));
     }
 
     @Test
-    public void testUpdateResourceFromYaml() throws IOException {
+    void testUpdateResourceFromYaml() throws IOException {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Resource newResource = createNewResource();
         Resource oldResource = createOldResource();
@@ -1837,21 +1972,21 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         boolean isNested = true;
 
         when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), anyMap(), any(CsarInfo.class),
-                anyString(), any(Component.class))).thenReturn(getParsedToscaYamlInfo());
+            anyString(), any(Component.class))).thenReturn(getParsedToscaYamlInfo());
         when(serviceImportParseLogic.prepareResourceForUpdate(any(Resource.class), any(Resource.class),
-                any(User.class), anyBoolean(), anyBoolean())).thenReturn(oldResource);
+            any(User.class), anyBoolean(), anyBoolean())).thenReturn(oldResource);
         when(serviceImportParseLogic.validateCapabilityTypesCreate(any(User.class), any(ICapabilityTypeOperation.class),
-                any(Resource.class), any(AuditingActionEnum.class), anyBoolean())).thenReturn(Either.left(true));
+            any(Resource.class), any(AuditingActionEnum.class), anyBoolean())).thenReturn(Either.left(true));
         when(toscaOperationFacade.overrideComponent(any(Resource.class), any(Resource.class)))
-                .thenReturn(Either.left(newResource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .updateResourceFromYaml(oldResource, newResource, actionEnum, createdArtifacts,
-                        yamlFileName, yamlFileContent, csarInfo, nodeTypesInfo,
-                        nodeTypesArtifactsToHandle, nodeName, isNested));
+            .thenReturn(Either.left(newResource));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .updateResourceFromYaml(oldResource, newResource, actionEnum, createdArtifacts,
+                yamlFileName, yamlFileContent, csarInfo, nodeTypesInfo,
+                nodeTypesArtifactsToHandle, nodeName, isNested));
     }
 
     @Test
-    public void testCreateResourceFromYaml() throws IOException {
+    void testCreateResourceFromYaml() throws IOException {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Resource resource = createParseResourceObject(true);
         String topologyTemplateYaml = getMainTemplateContent();
@@ -1867,21 +2002,19 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         boolean shouldLock = false;
         boolean inTransaction = true;
 
-
         when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), anyMap(), any(CsarInfo.class),
-                anyString(), any(Component.class))).thenReturn(getParsedToscaYamlInfo());
-        when(serviceBusinessLogic.fetchAndSetDerivedFromGenericType(any(Resource.class))).thenReturn(resource);
-        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(ResourceTypeEnum.class)
-                , any(ComponentTypeEnum.class))).thenReturn(Either.left(false));
+            anyString(), any(Component.class))).thenReturn(getParsedToscaYamlInfo());
+        when(serviceBusinessLogic.fetchAndSetDerivedFromGenericType(any(Component.class))).thenReturn(resource);
+        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(ResourceTypeEnum.class), any(ComponentTypeEnum.class)))
+            .thenReturn(Either.left(false));
         when(toscaOperationFacade.createToscaComponent(any(Resource.class))).thenReturn(Either.left(resource));
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createResourceFromYaml(resource,
-                topologyTemplateYaml, yamlName, nodeTypesInfo, csarInfo,
-                nodeTypesArtifactsToCreate, shouldLock, inTransaction, nodeName));
-
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createResourceFromYaml(resource,
+            topologyTemplateYaml, yamlName, nodeTypesInfo, csarInfo,
+            nodeTypesArtifactsToCreate, shouldLock, inTransaction, nodeName));
     }
 
     @Test
-    public void testCreateResourceAndRIsFromYaml() throws IOException {
+    void testCreateResourceAndRIsFromYaml() throws IOException {
         String yamlName = "group.yml";
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         Resource resource = createParseResourceObject(true);
@@ -1902,24 +2035,24 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         boolean shouldLock = false;
         boolean inTransaction = true;
         when(serviceBusinessLogic.fetchAndSetDerivedFromGenericType(any(Resource.class)))
-                .thenReturn(resource);
+            .thenReturn(resource);
 
         when(serviceBusinessLogic.lockComponentByName(anyString(), any(), anyString()))
-                .thenReturn(Either.left(true));
+            .thenReturn(Either.left(true));
 
-        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(ResourceTypeEnum.class)
-                , any(ComponentTypeEnum.class))).thenReturn(Either.left(false));
+        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(ResourceTypeEnum.class), any(ComponentTypeEnum.class)))
+            .thenReturn(Either.left(false));
 
         when(toscaOperationFacade.createToscaComponent(any(Resource.class))).thenReturn(Either.left(resource));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourceAndRIsFromYaml(yamlName, resource, parsedToscaYamlInfo, actionEnum,
-                        isNormative, createdArtifacts, topologyTemplateYaml, nodeTypesInfo, csarInfo,
-                        nodeTypesArtifactsToCreate, shouldLock, inTransaction, nodeName));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createResourceAndRIsFromYaml(yamlName, resource, parsedToscaYamlInfo, actionEnum,
+                isNormative, createdArtifacts, topologyTemplateYaml, nodeTypesInfo, csarInfo,
+                nodeTypesArtifactsToCreate, shouldLock, inTransaction, nodeName));
     }
 
     @Test
-    public void testCreateGroupsOnResource2() {
+    void testCreateGroupsOnResource2() {
         Resource resource = createParseResourceObject(false);
         Map<String, GroupDefinition> groups = null;
         List<GroupDefinition> groupDefinitionList = new ArrayList<>();
@@ -1927,45 +2060,40 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         groupDefinition.setUniqueId("groupDefinitionUniqueId");
         groupDefinition.setName("groupDefinition");
         groupDefinitionList.add(groupDefinition);
-        when(serviceImportParseLogic.validateCyclicGroupsDependencies(any()))
-                .thenReturn(Either.left(true));
+
         Assertions.assertNotNull(
-                sIB1.createGroupsOnResource(resource, groups));
+            sIBL.createGroupsOnResource(resource, groups));
     }
 
     @Test
-    public void testCreateGroupsOnResource2_null() {
+    void testCreateGroupsOnResource2_null() {
         Resource resource = createParseResourceObject(false);
         Map<String, GroupDefinition> groups = null;
 
-        Either<Resource, ResponseFormat> result = sIB1.createGroupsOnResource(resource, groups);
+        Either<Resource, ResponseFormat> result = sIBL.createGroupsOnResource(resource, groups);
         assertEquals(result.left().value(), resource);
     }
 
     @Test
-    public void testUpdateGroupsMembersUsingResource2() {
+    void testUpdateGroupsMembersUsingResource2() {
         Resource resource = createParseResourceObject(true);
         Map<String, GroupDefinition> groups = getGroups();
-        when(serviceImportParseLogic.validateCyclicGroupsDependencies(any()))
-                .thenReturn(Either.left(true));
-        Assertions.assertNotNull(
-                sIB1.updateGroupsMembersUsingResource(groups, resource));
 
+        Assertions.assertNotNull(
+            sIBL.updateGroupsMembersUsingResource(groups, resource));
     }
 
     @Test
-    public void testUpdateGroupsMembersUsingResource_left2() {
+    void testUpdateGroupsMembersUsingResource_left2() {
         Resource resource = createParseResourceObject(true);
         Map<String, GroupDefinition> groups = getGroups();
-        when(serviceImportParseLogic.validateCyclicGroupsDependencies(any()))
-                .thenReturn(Either.left(true));
-        Assertions.assertNotNull(
-                sIB1.updateGroupsMembersUsingResource(groups, resource));
 
+        Assertions.assertNotNull(
+            sIBL.updateGroupsMembersUsingResource(groups, resource));
     }
 
     @Test
-    public void testUpdateGroupMembers() throws IOException {
+    void testUpdateGroupMembers() throws IOException {
         Map<String, GroupDefinition> groups = new HashMap<>();
         GroupDefinition updatedGroupDefinition = new GroupDefinition();
         Resource component = createParseResourceObject(true);
@@ -1975,11 +2103,11 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         members.put("zxjTestImportServiceAb", getGroupsYaml());
         Assertions.assertNotNull(component);
 
-        sIB1.updateGroupMembers(groups, updatedGroupDefinition, component, componentInstances, groupName, members);
+        sIBL.updateGroupMembers(groups, updatedGroupDefinition, component, componentInstances, groupName, members);
     }
 
     @Test
-    public void testUpdateGroupMembers_null() throws IOException {
+    void testUpdateGroupMembers_null() throws IOException {
         Map<String, GroupDefinition> groups = new HashMap<>();
         GroupDefinition updatedGroupDefinition = new GroupDefinition();
         Resource component = createParseResourceObject(true);
@@ -1988,71 +2116,64 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, String> members = new HashMap<>();
         members.put("zxjTestImportServiceAb", getGroupsYaml());
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.updateGroupMembers(groups,
-                updatedGroupDefinition, component, componentInstances, groupName, members));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.updateGroupMembers(groups,
+            updatedGroupDefinition, component, componentInstances, groupName, members));
     }
 
     @Test
-    public void setCreateResourceTransaction() {
+    void setCreateResourceTransaction() {
         Resource resource = createParseResourceObject(false);
         resource.setComponentType(ComponentTypeEnum.RESOURCE);
         boolean isNormative = true;
-        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(), any()))
-                .thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
+        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(ResourceTypeEnum.class), any(ComponentTypeEnum.class)))
+            .thenReturn(Either.right(StorageOperationStatus.BAD_REQUEST));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createResourceTransaction(resource,
-                user, isNormative));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createResourceTransaction(resource, user, isNormative));
     }
 
     @Test
-    public void setCreateResourceTransaction_leftTrue() {
+    void setCreateResourceTransaction_leftTrue() {
         Resource resource = createParseResourceObject(false);
         resource.setComponentType(ComponentTypeEnum.RESOURCE);
         boolean isNormative = true;
-        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(), any()))
-                .thenReturn(Either.left(true));
+        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(), any())).thenReturn(Either.left(true));
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourceTransaction(resource, user, isNormative));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createResourceTransaction(resource, user, isNormative));
     }
 
     @Test
-    public void setCreateResourceTransaction_Left() {
+    void setCreateResourceTransaction_Left() {
         Resource resource = createParseResourceObject(false);
         resource.setComponentType(ComponentTypeEnum.RESOURCE);
-        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(), any()))
-                .thenReturn(Either.left(false));
+        when(toscaOperationFacade.validateComponentNameExists(anyString(), any(), any())).thenReturn(Either.left(false));
         when(toscaOperationFacade.createToscaComponent(any(Resource.class))).thenReturn(Either.left(resource));
-        Assertions.assertNotNull(
-                sIB1.createResourceTransaction(resource, user, false));
+        Assertions.assertNotNull(sIBL.createResourceTransaction(resource, user, false));
     }
 
     @Test
-    public void testUpdateExistingResourceByImport() {
+    void testUpdateExistingResourceByImport() {
         Resource newResource = createNewResource();
         Resource oldResource = createOldResource();
         when(serviceImportParseLogic.prepareResourceForUpdate(any(Resource.class), any(Resource.class),
-                any(User.class), anyBoolean(), anyBoolean())).thenReturn(oldResource);
+            any(User.class), anyBoolean(), anyBoolean())).thenReturn(oldResource);
         when(serviceImportParseLogic.validateCapabilityTypesCreate(any(User.class), any(ICapabilityTypeOperation.class),
-                any(Resource.class), any(AuditingActionEnum.class), anyBoolean())).thenReturn(Either.left(true));
+            any(Resource.class), any(AuditingActionEnum.class), anyBoolean())).thenReturn(Either.left(true));
         when(toscaOperationFacade.overrideComponent(any(Resource.class), any(Resource.class)))
-                .thenReturn(Either.left(newResource));
-        Assertions.assertNotNull(
-                sIB1.updateExistingResourceByImport(newResource, oldResource, user,
-                        true, false, true));
+            .thenReturn(Either.left(newResource));
+        Assertions.assertNotNull(sIBL.updateExistingResourceByImport(newResource, oldResource, user, true, false, true));
     }
 
     @Test
-    public void testCreateNewResourceToOldResource() {
+    void testCreateNewResourceToOldResource() {
         Resource newResource = createNewResource();
         Resource oldResource = createOldResource();
 
-        sIB1.createNewResourceToOldResource(newResource, oldResource, user);
+        sIBL.createNewResourceToOldResource(newResource, oldResource, user);
         assertEquals(newResource.getSystemName(), oldResource.getSystemName());
     }
 
     @Test
-    public void testCreateResourcesFromYamlNodeTypesList() {
+    void testCreateResourcesFromYamlNodeTypesList() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         Map<String, Object> mappedToscaTemplate = new HashMap<>();
@@ -2062,25 +2183,25 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, NodeTypeInfo> nodeTypesInfo = new HashMap<>();
         CsarInfo csarInfo = getCsarInfo();
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1
-                .createResourcesFromYamlNodeTypesList(yamlName, service, mappedToscaTemplate, needLock,
-                        nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL
+            .createResourcesFromYamlNodeTypesList(yamlName, service, mappedToscaTemplate, needLock,
+                nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo));
     }
 
     @Test
-    public void testCreateNodeTypes() {
+    void testCreateNodeTypes() {
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         boolean needLock = true;
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>> enumListEnumMap =
-                new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         List<ArtifactDefinition> artifactDefinitions = new ArrayList<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
         artifactDefinition.setArtifactName("artifactName");
         artifactDefinitions.add(artifactDefinition);
         enumListEnumMap.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE,
-                artifactDefinitions);
+            artifactDefinitions);
         nodeTypesArtifactsToHandle.put("nodeTyp", enumListEnumMap);
         List<ArtifactDefinition> nodeTypesNewCreatedArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
@@ -2090,28 +2211,28 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         NodeTypeInfo nodeTypeInfo = new NodeTypeInfo();
         nodeTypesInfo.put("nodeTyp", nodeTypeInfo);
         nodeTypes.put("org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test",
-                nodeTypeInfo);
+            nodeTypeInfo);
 
-        Assertions.assertThrows(ComponentException.class, () -> sIB1.createNodeTypes(yamlName,
-                service, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
-                nodeTypesInfo, csarInfo, mapToConvert, nodeTypes));
+        Assertions.assertThrows(ComponentException.class, () -> sIBL.createNodeTypes(yamlName,
+            service, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
+            nodeTypesInfo, csarInfo, mapToConvert, nodeTypes));
     }
 
     @Test
-    public void testCreateNodeTypesElse() {
+    void testCreateNodeTypesElse() {
         String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
         String yamlName = "group.yml";
         Service service = createServiceObject(true);
         boolean needLock = true;
         Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
         EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>> enumListEnumMap =
-                new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
+            new EnumMap<>(ArtifactsBusinessLogic.ArtifactOperationEnum.class);
         List<ArtifactDefinition> artifactDefinitions = new ArrayList<>();
         ArtifactDefinition artifactDefinition = new ArtifactDefinition();
         artifactDefinition.setArtifactName("artifactName");
         artifactDefinitions.add(artifactDefinition);
         enumListEnumMap.put(ArtifactsBusinessLogic.ArtifactOperationEnum.CREATE,
-                artifactDefinitions);
+            artifactDefinitions);
         nodeTypesArtifactsToHandle.put("nodeTyp", enumListEnumMap);
         List<ArtifactDefinition> nodeTypesNewCreatedArtifacts = new ArrayList<>();
         Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
@@ -2125,16 +2246,15 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         Map<String, Object> nodeTypes = new HashMap<>();
         NodeTypeInfo nodeTypeInfo = new NodeTypeInfo();
         nodeTypes.put("org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test",
-                nodeTypeInfo);
+            nodeTypeInfo);
         when(serviceImportParseLogic.createNodeTypeResourceFromYaml(anyString(), any(Map.Entry.class), any(User.class),
-                anyMap(), any(Service.class), anyBoolean(), anyMap(), anyList(), anyBoolean(), any(CsarInfo.class),
-                anyBoolean())).thenReturn(getResourceCreated());
+            anyMap(), any(Service.class), anyBoolean(), anyMap(), anyList(), anyBoolean(), any(CsarInfo.class),
+            anyBoolean())).thenReturn(getResourceCreated());
         Assertions.assertNotNull(service);
 
-        sIB1.createNodeTypes(yamlName,
-                service, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
-                nodeTypesInfo, csarInfo, mapToConvert, nodeTypes);
-
+        sIBL.createNodeTypes(yamlName,
+            service, needLock, nodeTypesArtifactsToHandle, nodeTypesNewCreatedArtifacts,
+            nodeTypesInfo, csarInfo, mapToConvert, nodeTypes);
     }
 
     protected ImmutablePair<Resource, ActionStatus> getResourceCreated() {
@@ -2226,8 +2346,7 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         return propertyList;
     }
 
-
-    protected Map<String, NodeTypeInfo> getNodeTypesInfo() {
+    private Map<String, NodeTypeInfo> getNodeTypesInfo() {
         Map<String, NodeTypeInfo> nodeTypesInfo = new HashMap<>();
         NodeTypeInfo nodeTypeInfo = new NodeTypeInfo();
         Map<String, Object> mappedToscaTemplate = new HashMap<>();
@@ -2239,9 +2358,21 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         return nodeTypesInfo;
     }
 
-    protected Map<String, UploadComponentInstanceInfo> getUploadResInstancesMap() {
+    private Map<String, Object> getNodeTypes() {
+        Map<String, Object> nodeTypesInfo = new HashMap<>();
+        NodeTypeInfo nodeTypeInfo = new NodeTypeInfo();
+        Map<String, Object> mappedToscaTemplate = new HashMap<>();
+        nodeTypeInfo.setNested(true);
+        nodeTypeInfo.setTemplateFileName("templateFileName");
+        nodeTypeInfo.setMappedToscaTemplate(mappedToscaTemplate);
+        String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
+        nodeTypesInfo.put(nodeName, nodeTypeInfo);
+        return nodeTypesInfo;
+    }
+
+    private Map<String, UploadComponentInstanceInfo> getUploadResInstancesMap() {
         Map<String, UploadComponentInstanceInfo> uploadResInstancesMap = new HashMap<>();
-        UploadComponentInstanceInfo uploadComponentInstanceInfo = getuploadComponentInstanceInfo();
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = getUploadComponentInstanceInfo();
         Map<String, String> capabilitiesNamesToUpdate = new HashMap<>();
         capabilitiesNamesToUpdate.put("mme_ipu_vdu.feature", "capabilitiesNamesToUpdate");
         Map<String, String> requirementsNamesToUpdate = new HashMap<>();
@@ -2313,13 +2444,13 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
             privateMethod = AbstractValidationsServlet.class.getDeclaredMethod("getCsarFromPayload", UploadResourceInfo.class);
             privateMethod.setAccessible(true);
             returnValue = (Map<String, byte[]>) privateMethod.invoke(servlet, resourceInfo);
-        } catch (IOException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+        } catch (IOException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException |
+                 InvocationTargetException e) {
             e.printStackTrace();
         }
         return returnValue;
     }
 
-
     protected List<ComponentInstance> creatComponentInstances() {
         List<ComponentInstance> componentInstances = new ArrayList<>();
         ComponentInstance componentInstance = new ComponentInstance();
@@ -2341,14 +2472,16 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         componentInstance.setUniqueId("uniqueId");
         componentInstance.setComponentUid("componentUid");
         componentInstance.setName("zxjTestImportServiceAb");
+        componentInstance.setNormalizedName("zxjTestImportServiceAb");
+        componentInstance.setProperties(getProperties());
         componentInstances.add(componentInstance);
         return componentInstances;
     }
 
-    protected CreateServiceFromYamlParameter getCsfyp() {
+    private CreateServiceFromYamlParameter getCsfyp() {
         CreateServiceFromYamlParameter csfyp = new CreateServiceFromYamlParameter();
         List<ArtifactDefinition> createdArtifacts = new ArrayList<>();
-        Map<String, NodeTypeInfo> nodeTypesInfo = new HashedMap();
+        Map<String, NodeTypeInfo> nodeTypesInfo = getNodeTypesInfo();
 
         csfyp.setNodeName("org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test");
         csfyp.setTopologyTemplateYaml(getMainTemplateContent("service_import_template.yml"));
@@ -2362,12 +2495,11 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         return csfyp;
     }
 
-    protected ParsedToscaYamlInfo getParsedToscaYamlInfo() {
+    private ParsedToscaYamlInfo getParsedToscaYamlInfo() {
         ParsedToscaYamlInfo parsedToscaYamlInfo = new ParsedToscaYamlInfo();
         Map<String, InputDefinition> inputs = new HashMap<>();
         Map<String, UploadComponentInstanceInfo> instances = new HashMap<>();
-        UploadComponentInstanceInfo uploadComponentInstanceInfo = new UploadComponentInstanceInfo();
-        uploadComponentInstanceInfo.setName("uploadComponentInstanceInfo");
+        UploadComponentInstanceInfo uploadComponentInstanceInfo = getUploadComponentInstanceInfo();
         instances.put("instances", uploadComponentInstanceInfo);
         Map<String, GroupDefinition> groups = new HashMap<>();
         Map<String, PolicyDefinition> policies = new HashMap<>();
@@ -2388,28 +2520,43 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         return mainTemplateContent;
     }
 
-    protected CsarInfo getCsarInfo() {
+    protected ServiceCsarInfo getCsarInfo() {
         String csarUuid = "0010";
-        User user = new User();
-        Map<String, byte[]> csar = crateCsarFromPayload();
-        String vfReousrceName = "resouceName";
-        String mainTemplateName = "mainTemplateName";
-        String mainTemplateContent = getMainTemplateContent("service_import_template.yml");
-        CsarInfo csarInfo = new CsarInfo(user, csarUuid, csar, vfReousrceName, mainTemplateName, mainTemplateContent, false);
-        return csarInfo;
-    }
+        User user = new User("jh0003");
 
-    public static String loadFileNameToJsonString(String fileName) throws IOException {
-        String sourceDir = "src/test/resources/normativeTypes";
-        return loadFileNameToJsonString(sourceDir, fileName);
+        try {
+            File csarFile = new File(
+                ServiceImportBusinessLogicTest.class.getClassLoader().getResource("csars/service-Ser09080002-csar.csar").toURI());
+            Map<String, byte[]> csar = ZipUtils.readZip(csarFile, false);
+
+            String vfReousrceName = "resouceName";
+            String mainTemplateName = "Definitions/service_import_template.yml";
+
+            Optional<String> keyOp = csar.keySet().stream().filter(k -> k.endsWith("service-Ser09080002-template.yml")).findAny();
+            byte[] mainTemplateService = keyOp.map(csar::get).orElse(null);
+            assertNotNull(mainTemplateService);
+            final String mainTemplateContent = new String(mainTemplateService);
+
+            return new ServiceCsarInfo(user, csarUuid, csar, vfReousrceName, null, mainTemplateName, mainTemplateContent, false,
+                mock(ModelOperation.class));
+        } catch (URISyntaxException | ZipException e) {
+            fail(e);
+        }
+        return null;
     }
 
-    private static String loadFileNameToJsonString(String sourceDir, String fileName) throws IOException {
-        java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir, fileName);
-        byte[] fileContent = Files.readAllBytes(filePath);
-        return new String(fileContent);
-    }
+    private ImmutablePair<String, byte[]> getNodeType() {
+        try {
+            File resource = new File(
+                ServiceImportBusinessLogicTest.class.getClassLoader().getResource("node-types/resource-Extcp-template.yml").toURI());
+            byte[] extcpResource = Files.readAllBytes(resource.toPath());
 
+            return new ImmutablePair<>("org.openecomp.resource.cp.extCP", extcpResource);
+        } catch (URISyntaxException | IOException e) {
+            fail(e);
+        }
+        return null;
+    }
 
     protected CsarUtils.NonMetaArtifactInfo getNonMetaArtifactInfo() {
         String artifactName = "artifactName", path = "/src/test/resources/valid_vf.csar", artifactType = "AAI_SERVICE_MODEL";
@@ -2426,14 +2573,14 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest
         String artifactUniqueId = "artifactUniqueId";
         boolean isFromCsar = true;
         CsarUtils.NonMetaArtifactInfo nonMetaArtifactInfo = new CsarUtils.NonMetaArtifactInfo(artifactName,
-                path, artifactType, artifactGroupType, data, artifactUniqueId, isFromCsar);
+            path, artifactType, artifactGroupType, data, artifactUniqueId, isFromCsar);
         return nonMetaArtifactInfo;
 
     }
 
     protected void assertComponentException(ComponentException e, ActionStatus expectedStatus, String... variables) {
         ResponseFormat actualResponse = e.getResponseFormat() != null ?
-                e.getResponseFormat() : componentsUtils.getResponseFormat(e.getActionStatus(), e.getParams());
+            e.getResponseFormat() : componentsUtils.getResponseFormat(e.getActionStatus(), e.getParams());
         assertParseResponse(actualResponse, expectedStatus, variables);
     }